mirror of
https://github.com/thegeeklab/drone-plugin-lib.git
synced 2024-11-16 23:00:39 +00:00
23 lines
333 B
Go
23 lines
333 B
Go
|
package template
|
||
|
|
||
|
import (
|
||
|
"text/template"
|
||
|
|
||
|
"github.com/Masterminds/sprig/v3"
|
||
|
)
|
||
|
|
||
|
func loadFuncMap() template.FuncMap {
|
||
|
sprigFuncs := sprig.GenericFuncMap()
|
||
|
customFuncs := template.FuncMap{}
|
||
|
|
||
|
for name, f := range customFuncs {
|
||
|
if _, ok := sprigFuncs[name]; ok {
|
||
|
continue
|
||
|
}
|
||
|
|
||
|
sprigFuncs[name] = f
|
||
|
}
|
||
|
|
||
|
return sprigFuncs
|
||
|
}
|