更新mod库、编码、poc等

This commit is contained in:
shadow1ng
2021-05-06 11:37:29 +08:00
parent 7294051b44
commit 402add56c7
31 changed files with 388 additions and 62 deletions
+3 -3
View File
@@ -26,19 +26,19 @@ func NewEnv(c *CustomLib) (*cel.Env, error) {
func Evaluate(env *cel.Env, expression string, params map[string]interface{}) (ref.Val, error) {
ast, iss := env.Compile(expression)
if iss.Err() != nil {
//fmt.Println("compile: ", iss.Err())
//fmt.Printf("compile: ", iss.Err())
return nil, iss.Err()
}
prg, err := env.Program(ast)
if err != nil {
//fmt.Println("Program creation error: %v", err)
//fmt.Printf("Program creation error: %v", err)
return nil, err
}
out, _, err := prg.Eval(params)
if err != nil {
//fmt.Println("Evaluation error: %v", err)
//fmt.Printf("Evaluation error: %v", err)
return nil, err
}
return out, nil