expr
expr copied to clipboard
how to new a string slice in expr
---------------code -------------------------- exprStr := "join([]string{'foo','bar'})" m := make[string]interface{} m['join'] = func(input []string) { // do something } program, err := expr.Compile(exprStr, expr.Env(m)) if err != nil { return } res, err := expr.Run(program, m) ---------------errorMsg----------------------------- unexpected token Identifier("string") ---------------question----------------------------- how to new a string slice in expr