fix: close file (#213)

This commit is contained in:
guangwu 2024-05-13 01:00:03 +08:00 committed by David Dworken
parent 711b75e519
commit 2b024c8054
No known key found for this signature in database

View File

@ -172,6 +172,7 @@ func countLinesInFile(filename string) (int, error) {
if err != nil {
return 0, err
}
defer file.Close()
buf := make([]byte, 32*1024)
count := 0
lineSep := []byte{'\n'}