From 79728a93dab1d1cba34d03057c298ca46c1eb8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Wo=C5=BAniak?= Date: Sun, 9 Apr 2017 15:15:06 +0200 Subject: [PATCH] Properly close file handle in readdir (#74) --- nav.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nav.go b/nav.go index 95acee8..1bc6423 100644 --- a/nav.go +++ b/nav.go @@ -91,6 +91,8 @@ func readdir(path string) ([]*file, error) { } names, err := f.Readdirnames(-1) + f.Close() + fi := make([]*file, 0, len(names)) for _, filename := range names { if !gOpts.hidden && filename[0] == '.' {