mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-10 23:51:24 +01:00
fix: close file (#213)
This commit is contained in:
parent
711b75e519
commit
2b024c8054
@ -172,6 +172,7 @@ func countLinesInFile(filename string) (int, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
defer file.Close()
|
||||||
buf := make([]byte, 32*1024)
|
buf := make([]byte, 32*1024)
|
||||||
count := 0
|
count := 0
|
||||||
lineSep := []byte{'\n'}
|
lineSep := []byte{'\n'}
|
||||||
|
Loading…
Reference in New Issue
Block a user