Browse Source

fix: close file (#1274)

guoguangwu 10 months ago
parent
commit
27d9ebad38
1 changed files with 1 additions and 0 deletions
  1. 1 0
      config/configurators/configurators.go

+ 1 - 0
config/configurators/configurators.go

@@ -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() {