1
0
mirror of https://github.com/kataras/iris.git synced 2026-02-28 05:26:00 +00:00
Makis Maropoulos
2016-06-02 18:27:35 +03:00
parent 7f82b101c7
commit 56a9fba34d
2 changed files with 13 additions and 3 deletions

10
iris.go
View File

@@ -134,6 +134,16 @@ func (s *Iris) initTemplates() {
return "", nil
},
}
// these should be already a non-nil map but if .New(cfg) it's not, is mergo's bug, temporary:
if s.config.Render.Template.HTMLTemplate.LayoutFuncs == nil {
s.config.Render.Template.HTMLTemplate.LayoutFuncs = make(map[string]interface{}, 1)
}
if s.config.Render.Template.HTMLTemplate.Funcs == nil {
s.config.Render.Template.HTMLTemplate.Funcs = make(map[string]interface{}, 1)
}
//
for k, v := range funcs {
// we don't want to override the user's LayoutFuncs, user should be able to override anything.
if s.config.Render.Template.HTMLTemplate.LayoutFuncs[k] == nil {