Browse Source

fix: close file (#1274)

guoguangwu 1 năm trước cách đây
mục cha
commit
27d9ebad38
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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() {