MCPcopy
hub / github.com/expr-lang/expr / ExampleEval

Function ExampleEval

expr_test.go:26–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24)
25
26func ExampleEval() {
27 output, err := expr.Eval("greet + name", map[string]any{
28 "greet": "Hello, ",
29 "name": "world!",
30 })
31 if err != nil {
32 fmt.Printf("err: %v", err)
33 return
34 }
35
36 fmt.Printf("%v", output)
37
38 // Output: Hello, world!
39}
40
41func ExampleEval_runtime_error() {
42 _, err := expr.Eval(`map(1..3, {1 % (# - 3)})`, nil)

Callers

nothing calls this directly

Calls 2

EvalFunction · 0.92
PrintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…