1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

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

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)