Updated Readme.md: file.Close() for template read (#2068)

This commit is contained in:
bullgare 2019-09-24 17:18:41 +03:00 committed by Bo-Yi Wu
parent d6eafcf48a
commit 9b9f4fab34

View File

@ -1807,6 +1807,7 @@ func main() {
func loadTemplate() (*template.Template, error) { func loadTemplate() (*template.Template, error) {
t := template.New("") t := template.New("")
for name, file := range Assets.Files { for name, file := range Assets.Files {
defer file.Close()
if file.IsDir() || !strings.HasSuffix(name, ".tmpl") { if file.IsDir() || !strings.HasSuffix(name, ".tmpl") {
continue continue
} }