templates/templates.go
func (t Templates) RenderTemplate(name, templateName string, data interface{}) (s string, err error) {
	buf := bytes.Buffer{}
	tpl, ok := t.templates[name]
	if !ok {
		return "", &Error{Err: ErrUnknownTemplate, Template: name}
	}
	if err := tpl.ExecuteTemplate(&buf, templateName, data); err != nil {
		return "", err
	}
	return buf.String(), nil
}
func (t Templates) RenderTemplate(name, templateName string, data interface{}) (s string, err error) {
	buf := bytes.Buffer{}
	tpl, ok := t.templates[name]
	if !ok {
		return "", &Error{Err: ErrUnknownTemplate, Template: name}
	}
	if err := tpl.ExecuteTemplate(&buf, templateName, data); err != nil {
		return "", err
	}
	return buf.String(), nil
}
// RenderTemplate executes a named template and returns the string.