Close file handle when finished reading file

This commit is contained in:
David Roda 2016-02-17 11:49:38 -05:00 committed by Bjørn Erik Pedersen
parent df17fae532
commit 284e959fc4

View file

@ -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)
}