Fix expr helpers "StartsWith" and "EndsWith" (#48)

* fix

* fix typo

Co-authored-by: AlteredCoder <AlteredCoder>
This commit is contained in:
AlteredCoder 2020-05-29 17:25:09 +02:00 committed by GitHub
parent 4e8aa19c09
commit 82d6e6938a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,15 @@ func EndsWith(s string, suff string) bool {
}
func GetExprEnv(ctx map[string]interface{}) map[string]interface{} {
var ExprLib = map[string]interface{}{"Atof": Atof, "JsonExtract": JsonExtract, "JsonExtractLib": JsonExtractLib, "File": File, "RegexpInFile": RegexpInFile}
var ExprLib = map[string]interface{}{
"Atof": Atof,
"StartsWith": StartsWith,
"EndsWith" : EndsWith,
"JsonExtract": JsonExtract,
"JsonExtractLib": JsonExtractLib,
"File": File,
"RegexpInFile": RegexpInFile,
}
for k, v := range ctx {
ExprLib[k] = v
}