Merge pull request #262 from CallanTaylor/close-file

Close file
pull/245/head^2
he liu 2019-11-30 21:54:16 +08:00 committed by GitHub
commit 605f4aface
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

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