The docstring for [html|text]/template.Funcs is as follows
package template // import "html/template"
func (t *Template) Funcs(funcMap FuncMap) *Template
Funcs adds the elements of the argument map to the template's function map.
It must be called before the template is parsed. It panics if a value in
the map is not a function with appropriate return type. However, it is
legal to overwrite elements of the map. The return value is the template,
so calls can be chained.
(The html version has the addition of "However"!).
It wasn't obvious to me that to "overwrite elements of the map" one could call
Funcs with a funcMap of just those funcs that should be replaced, as shown in
https://go.dev/play/p/LWRmEL9XZce, rather than having to re-add all the funcs.
Although this might be more obvious to experienced gophers, I suggest the
following addition to the docs:
...it is legal to overwrite elements of the map. For example, a func
registered with the name "x" before a template t is parsed might be
replaced after parsing the template as follows:
t.Funcs(template.FuncMap{"x": strings.ToUpper})
The return value...
Thanks
Rory