Use missingkey=zero option in templates

This commit is contained in:
Fabian Reinartz 2016-02-05 15:41:15 +01:00
parent 170906482d
commit 897b3a0366
1 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ func (t *Template) ExecuteTextString(text string, data interface{}) (string, err
if err != nil {
return "", err
}
tmpl, err = tmpl.New("").Parse(text)
tmpl, err = tmpl.New("").Option("missingkey=zero").Parse(text)
if err != nil {
return "", err
}
@ -100,7 +100,7 @@ func (t *Template) ExecuteHTMLString(html string, data interface{}) (string, err
if err != nil {
return "", err
}
tmpl, err = tmpl.New("").Parse(html)
tmpl, err = tmpl.New("").Option("missingkey=zero").Parse(html)
if err != nil {
return "", err
}