fix: close file (#1274)

This commit is contained in:
guoguangwu
2024-06-12 23:17:57 +08:00
committed by GitHub
parent e4bf5e93fb
commit 27d9ebad38

View File

@@ -66,6 +66,7 @@ func StringSliceFile(s *[]string, filepath string) error {
if err != nil {
return fmt.Errorf("Can't open file %s\n", filepath)
}
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {