From 8affab1a2b42e71916fa08c666edf3a5c6ca0e37 Mon Sep 17 00:00:00 2001 From: CallanTaylor Date: Tue, 12 Nov 2019 11:38:55 +1300 Subject: [PATCH] Close file --- assets/assets.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/assets.go b/assets/assets.go index 504c0e82..2a9e9772 100644 --- a/assets/assets.go +++ b/assets/assets.go @@ -55,6 +55,7 @@ func ReadFile(file string) (content string, err error) { if err != nil { return content, err } + defer file.Close() buf, err := ioutil.ReadAll(file) if err != nil { return content, err @@ -65,6 +66,7 @@ func ReadFile(file string) (content string, err error) { if err != nil { return content, err } + defer file.Close() buf, err := ioutil.ReadAll(file) if err != nil { return content, err