Properly close file handle in readdir (#74)

This commit is contained in:
Karol Woźniak 2017-04-09 15:15:06 +02:00 committed by gokcehan
parent 8bc975a858
commit 79728a93da

2
nav.go
View File

@ -91,6 +91,8 @@ func readdir(path string) ([]*file, error) {
} }
names, err := f.Readdirnames(-1) names, err := f.Readdirnames(-1)
f.Close()
fi := make([]*file, 0, len(names)) fi := make([]*file, 0, len(names))
for _, filename := range names { for _, filename := range names {
if !gOpts.hidden && filename[0] == '.' { if !gOpts.hidden && filename[0] == '.' {