From d93348842a9d348ddd19b7d10b25b24cc09813e7 Mon Sep 17 00:00:00 2001 From: Steven Tang Date: Sun, 24 Jan 2021 10:19:20 +1100 Subject: [PATCH] fix: delay defer templateFile.Close() --- routes/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/routes.go b/routes/routes.go index 7f25552..4f9b04b 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -62,10 +62,10 @@ func loadTemplates() { } templateFile, err := pkger.Open(fmt.Sprintf("%s/%s", tplPath, tplName)) - defer templateFile.Close() if err != nil { panic(err) } + defer templateFile.Close() template, err := ioutil.ReadAll(templateFile) if err != nil { panic(err)