1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 21:51:28 +00:00

Merge pull request #2067 from Maxgis/issue_accept_encoding

reflection
This commit is contained in:
astaxie 2016-07-29 09:59:59 +08:00 committed by GitHub
commit e4fe54f6cd

View File

@ -50,23 +50,17 @@ func ExecuteTemplate(wr io.Writer, name string, data interface{}) error {
defer templatesLock.RUnlock()
}
if t, ok := beeTemplates[name]; ok {
var err error
if t.Lookup(name) != nil {
err := t.ExecuteTemplate(wr, name, data)
if err != nil {
logs.Trace("template Execute err:", err)
}
return err
err = t.ExecuteTemplate(wr, name, data)
} else {
err := t.Execute(wr, data)
if err != nil {
err = t.Execute(wr, data)
}
if err != nil {
logs.Trace("template Execute err:", err)
}
return err
}
}
return nil
}
panic("can't find templatefile in the path:" + name)
}