mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Close file handle when finished reading file
This commit is contained in:
parent
df17fae532
commit
284e959fc4
1 changed files with 2 additions and 1 deletions
|
@ -88,7 +88,7 @@ func resGetCache(id string, fs afero.Fs, ignoreCache bool) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer f.Close()
|
||||
return ioutil.ReadAll(f)
|
||||
}
|
||||
|
||||
|
@ -167,6 +167,7 @@ func resGetLocal(url string, fs afero.Fs) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
return ioutil.ReadAll(f)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue