0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-13 17:19:11 +00:00

go.d sd fix sprig funcmap ()

This commit is contained in:
Ilya Mashchenko 2024-10-02 11:30:49 +03:00 committed by GitHub
parent 723a0a8c7a
commit c75e5140a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}