fix: close file (#213)

This commit is contained in:
guangwu 2024-05-13 01:00:03 +08:00 committed by GitHub
parent 998d507594
commit 35d873f618
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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'}