1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 22:50:50 +00:00

Merge pull request #3419 from xpzouying/close_fs_when_is_not_nil

Close fs when is not nil
This commit is contained in:
astaxie 2018-11-30 16:57:49 +08:00 committed by GitHub
commit 8152ade1b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,13 +186,13 @@ func BuildTemplate(dir string, files ...string) error {
var err error
fs := beeTemplateFS()
f, err := fs.Open(dir)
defer f.Close()
if err != nil {
if os.IsNotExist(err) {
return nil
}
return errors.New("dir open err")
}
defer f.Close()
beeTemplates, ok := beeViewPathTemplates[dir]
if !ok {