You are ignoring the error returned by
template.ParseFiles, that will probably tell you your problem. ParseFiles is probably throwing an error because the function
Split isn't defined when you parse the template. Never ignore errors.
To make it work, do something like this:
tplFuncMap = make(template.FuncMap) tplFuncMap["Split"] = Split tmpl, err = template.New("").Funcs(tplFuncMap).ParseFiles("a.html", "b.html")
The difference is that the
FuncMap is defined before the templates are parsed.