Merge pull request #242 from prometheus/zeroval

Use missingkey=zero option in templates
This commit is contained in:
Brian Brazil 2016-02-05 14:53:33 +00:00
commit e1530ba985
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
}