GoBroke/tplCmd/funcs.go
2025-02-04 12:14:08 -05:00

21 lines
401 B
Go

package tplCmd
import (
`text/template`
`github.com/Masterminds/sprig/v3`
)
// GetTpl returns a generic text/template.Template with the customization/FuncMap logic applied.
func GetTpl() (tpl *template.Template) {
tpl = template.New("")
tpl.Funcs(sprig.TxtFuncMap()).Funcs(TplFuncs)
if CombinedTplFuncMap != nil && len(CombinedTplFuncMap) > 0 {
tpl.Funcs(CombinedTplFuncMap)
}
return
}