fix: delay defer templateFile.Close()

This commit is contained in:
Steven Tang 2021-01-24 10:19:20 +11:00
parent fb92747129
commit d93348842a
No known key found for this signature in database
GPG Key ID: AA0C5A4496B7ADF5
1 changed files with 1 additions and 1 deletions

View File

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