mirror of
https://github.com/netdata/netdata.git
synced 2025-04-13 17:19:11 +00:00
go.d sd fix sprig funcmap (#18658)
This commit is contained in:
parent
723a0a8c7a
commit
c75e5140a9
1 changed files with 4 additions and 4 deletions
|
@ -14,7 +14,9 @@ import (
|
|||
)
|
||||
|
||||
func newFuncMap() template.FuncMap {
|
||||
custom := map[string]any{
|
||||
fm := sprig.TxtFuncMap()
|
||||
|
||||
extra := map[string]any{
|
||||
"match": funcMatchAny,
|
||||
"glob": func(value, pattern string, patterns ...string) bool {
|
||||
return funcMatchAny("glob", value, pattern, patterns...)
|
||||
|
@ -25,9 +27,7 @@ func newFuncMap() template.FuncMap {
|
|||
},
|
||||
}
|
||||
|
||||
fm := sprig.HermeticTxtFuncMap()
|
||||
|
||||
for name, fn := range custom {
|
||||
for name, fn := range extra {
|
||||
fm[name] = fn
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue