Skip to content

Commit 76320b6

Browse files
author
Jonathan Watson
committed
feat: panic if shelex regex is malformed
Change-Id: Iec341e19b2cd077ed3918bc309209d0f1425e3a0
1 parent d981887 commit 76320b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func applyTemplateString(elem reflect.Value, stringvalues map[string]string, fun
7575
func shlexExpand(field reflect.Value, stringvalues map[string]string) {
7676
// matches a value in the format of {{shlex .<value>}}
7777
pattern := "^\\{\\{\\s*shlex\\s+\\.(\\w+)\\s*\\}\\}$"
78-
regexpr, _ := regexp.Compile(pattern)
78+
regexpr := regexp.MustCompile(pattern)
7979
if field.Len() < 1 {
8080
return
8181
}

0 commit comments

Comments
 (0)