1> zzn..:
You can add functionality to the template, try this:
package main import ( "html/template" "log" "os" "time" ) func main() { funcMap := template.FuncMap{ "now": time.Now, } templateText := "The current year is {{now.UTC.Year}}" tmpl, err := template.New("titleTest").Funcs(funcMap).Parse(templateText) if err != nil { log.Fatalf("parsing: %s", err) } // Run the template to verify the output. err = tmpl.Execute(os.Stdout, nil) if err != nil { log.Fatalf("execution: %s", err) } }