21 lines
401 B
Go
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
|
||
|
}
|