Properly close file handle in readdir (#74)
This commit is contained in:
parent
8bc975a858
commit
79728a93da
2
nav.go
2
nav.go
@ -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] == '.' {
|
||||||
|
Loading…
Reference in New Issue
Block a user