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

Function ExampleAsKind

expr_test.go:249–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

247}
248
249func ExampleAsKind() {
250 program, err := expr.Compile("{a: 1, b: 2}", expr.AsKind(reflect.Map))
251 if err != nil {
252 fmt.Printf("%v", err)
253 return
254 }
255
256 output, err := expr.Run(program, nil)
257 if err != nil {
258 fmt.Printf("%v", err)
259 return
260 }
261
262 fmt.Printf("%v", output)
263
264 // Output: map[a:1 b:2]
265}
266
267func ExampleAsBool() {
268 env := map[string]int{

Callers

nothing calls this directly

Calls 4

CompileFunction · 0.92
AsKindFunction · 0.92
RunFunction · 0.92
PrintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…