Skip to content

Commit e6ab97f

Browse files
authored
close file explicitly, to avoid "max open files" error
1 parent cf5d9bf commit e6ab97f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

errcheck/errcheck.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ func readfile(filename string) []string {
543543
if err != nil {
544544
return nil
545545
}
546+
defer f.Close()
546547

547548
var lines []string
548549
var scanner = bufio.NewScanner(f)

0 commit comments

Comments
 (0)