mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-08 08:57:40 +08:00
change: make regexVariable as const
This commit is contained in:
@@ -41,8 +41,11 @@ func parseData(raw interface{}, variablesMapping map[string]interface{}) interfa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
const (
|
||||||
regexVariable = `[a-zA-Z_]\w*` // variable name should start with a letter or underscore
|
regexVariable = `[a-zA-Z_]\w*` // variable name should start with a letter or underscore
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
regexCompileVariable = regexp.MustCompile(fmt.Sprintf(`\$\{(%s)\}|\$(%s)`, regexVariable, regexVariable)) // parse ${var} or $var
|
regexCompileVariable = regexp.MustCompile(fmt.Sprintf(`\$\{(%s)\}|\$(%s)`, regexVariable, regexVariable)) // parse ${var} or $var
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user