From e6a1621261ff162fb016ecac966d616062b50922 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sat, 19 Mar 2022 22:02:46 +0300 Subject: [PATCH] cleanup --- nav.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nav.go b/nav.go index 04dabfc..81b1563 100644 --- a/nav.go +++ b/nav.go @@ -106,15 +106,15 @@ func readdir(path string) ([]*file, error) { d, err := os.Open(fpath) if err != nil { dirCount = -2 - } - - names, err := d.Readdirnames(1000) - d.Close() - - if names == nil && err != io.EOF { - dirCount = -2 } else { - dirCount = len(names) + names, err := d.Readdirnames(1000) + d.Close() + + if names == nil && err != io.EOF { + dirCount = -2 + } else { + dirCount = len(names) + } } }