Kaynağa Gözat

Merge pull request #262 from CallanTaylor/close-file

Close file
he liu 5 yıl önce
ebeveyn
işleme
605f4aface
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  1. 1 0
      lib/common/util.go

+ 1 - 0
lib/common/util.go

@@ -121,6 +121,7 @@ func ReadAllFromFile(filePath string) ([]byte, error) {
 	if err != nil {
 		return nil, err
 	}
+	defer f.Close()
 	return ioutil.ReadAll(f)
 }