func RenderTemplateWithFuncs(templateName, templateContent string, data interface{}) ([]byte, error) {
	funcMap := template.FuncMap{
		"hasIP":   hasIP,
		"ToLower": strings.ToLower,
	}

	tpl := template.Must(template.New(templateName).Funcs(funcMap).Parse(templateContent))

	strBuffer := new(bytes.Buffer)

	err := tpl.Execute(strBuffer, data)
	if err != nil {
		return nil, err
	}

	return strBuffer.Bytes(), nil
}
// Returns string content of a rendered template (with template functions)
Returns string content of a rendered template (with template functions)
// Returns string content of a rendered template ( with template functions )
func RenderTemplateWithFuncs(templateName, templateContent string, data interface{}) ([]byte, error) {
	funcMap := template.FuncMap{
		"hasIP":   hasIP,
		"ToLower": strings.ToLower,
	}
	tpl := template.Must(template.New(templateName).Funcs(funcMap).Parse(templateContent))
	strBuffer := new(bytes.Buffer)
	err := tpl.Execute(strBuffer, data)
	if err != nil {
		return nil, err
	}
	return strBuffer.Bytes(), nil
}
func RenderTemplateWithFuncs ( templateName , templateContent string , data interface { } ) ( [ ] byte , error ) { funcMap := template . FuncMap { " " : hasIP , " " : strings . ToLower , } tpl := template . Must ( template . New ( templateName ) . Funcs ( funcMap ) . Parse ( templateContent ) ) strBuffer := new ( bytes . Buffer ) err := tpl . Execute ( strBuffer , data ) if err != nil { return nil , err } return strBuffer . Bytes ( ) , nil }
Returns string content of a rendered template (with template functions)
Returns string content of a rendered template ( with template functions )