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

Function ToBool

vm/runtime/runtime.go:416–426  ·  view source on GitHub ↗
(a any)

Source from the content-addressed store, hash-verified

414}
415
416func ToBool(a any) bool {
417 if a == nil {
418 return false
419 }
420 switch x := a.(type) {
421 case bool:
422 return x
423 default:
424 panic(fmt.Sprintf("invalid operation: bool(%T)", x))
425 }
426}
427
428func IsNil(v any) bool {
429 if v == nil {

Callers 1

RunMethod · 0.92

Calls 1

SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…