Skip to content

Commit

Permalink
close file explicitly, to avoid "max open files" error
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored Jun 24, 2021
1 parent cf5d9bf commit e6ab97f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions errcheck/errcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ func readfile(filename string) []string {
if err != nil {
return nil
}
defer f.Close()

var lines []string
var scanner = bufio.NewScanner(f)
Expand Down

0 comments on commit e6ab97f

Please sign in to comment.