Commit 4c2ada1e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

common: clone template during validation to avoid unnecessary children

parent 7883d937
......@@ -50,7 +50,12 @@ func (t *Template) Process(s string, data interface{}) (string, error) {
// Validate the template.
func (t *Template) Validate(s string) error {
_, err := t.root.New(t.nextTemplateName()).Parse(s)
root, err := t.root.Clone()
if err != nil {
return err
}
_, err = root.New("template").Parse(s)
return err
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment