change: make regexVariable as const

This commit is contained in:
debugtalk
2021-09-29 12:03:12 +08:00
parent e007d0dc24
commit d04642eace

View File

@@ -41,8 +41,11 @@ func parseData(raw interface{}, variablesMapping map[string]interface{}) interfa
}
}
const (
regexVariable = `[a-zA-Z_]\w*` // variable name should start with a letter or underscore
)
var (
regexVariable = `[a-zA-Z_]\w*` // variable name should start with a letter or underscore
regexCompileVariable = regexp.MustCompile(fmt.Sprintf(`\$\{(%s)\}|\$(%s)`, regexVariable, regexVariable)) // parse ${var} or $var
)