Skip to content

Commit 9362148

Browse files
committed
🐛 Fix some go template helpers for yaml-based plugins
1 parent 4ddffe9 commit 9362148

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins_custom.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,20 @@ var funcmap = template.FuncMap{
200200
"escape": func(data string) string {
201201
return shellescape.Quote(data)
202202
},
203-
"hasMatch": func(pattern string, data []string) bool {
203+
"hasMatch": func(pattern string, data []any) bool {
204204
pat := regexp.MustCompile(pattern)
205205
for _, item := range data {
206-
if pat.MatchString(item) {
206+
if pat.MatchString(item.(string)) {
207207
return true
208208
}
209209
}
210210
return false
211211
},
212-
"findMatch": func(pattern string, data []string) string {
212+
"findMatch": func(pattern string, data []any) string {
213213
pat := regexp.MustCompile(pattern)
214214
for _, item := range data {
215-
if pat.MatchString(item) {
216-
return item
215+
if pat.MatchString(item.(string)) {
216+
return item.(string)
217217
}
218218
}
219219
return ""

0 commit comments

Comments
 (0)