MCPcopy Create free account
hub / github.com/expr-lang/expr / ExampleAnyValuer

Function ExampleAnyValuer

patcher/value/value_example_test.go:23–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func ExampleAnyValuer() {
24 env := make(map[string]any)
25 env["ValueOne"] = &myInt{1}
26 env["ValueTwo"] = &myInt{2}
27
28 program, err := expr.Compile("ValueOne + ValueTwo", expr.Env(env), value.ValueGetter)
29
30 if err != nil {
31 panic(err)
32 }
33
34 out, err := vm.Run(program, env)
35
36 if err != nil {
37 panic(err)
38 }
39
40 fmt.Println(out)
41 // Output: 3
42}

Callers

nothing calls this directly

Calls 4

CompileFunction · 0.92
EnvStruct · 0.92
RunFunction · 0.92
PrintlnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…