hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 284e959fc441b86b243b0a46bb9cab6ab490c416
parent df17fae5327066c61b717c81c114e40af05cdd8e
Author: David Roda <droda@dramafever.com>
Date:   Wed, 17 Feb 2016 11:49:38 -0500

Close file handle when finished reading file

Diffstat:
Mtpl/template_resources.go | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tpl/template_resources.go b/tpl/template_resources.go
@@ -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)
 }