浏览代码

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

bullgare 6 年之前
父节点
当前提交
9b9f4fab34
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      README.md

+ 1 - 0
README.md

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