MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Resolve

Method Resolve

interpreter/attributes.go:572–584  ·  view source on GitHub ↗

Resolve evaluates the condition, and then resolves the truthy or falsy branch accordingly.

(vars Activation)

Source from the content-addressed store, hash-verified

570
571// Resolve evaluates the condition, and then resolves the truthy or falsy branch accordingly.
572func (a *conditionalAttribute) Resolve(vars Activation) (any, error) {
573 val := a.expr.Eval(vars)
574 if val == types.True {
575 return a.truthy.Resolve(vars)
576 }
577 if val == types.False {
578 return a.falsy.Resolve(vars)
579 }
580 if types.IsUnknown(val) {
581 return val, nil
582 }
583 return nil, types.MaybeNoSuchOverloadErr(val).(*types.Err)
584}
585
586// String is an implementation of the Stringer interface method.
587func (a *conditionalAttribute) String() string {

Callers

nothing calls this directly

Calls 4

IsUnknownFunction · 0.92
MaybeNoSuchOverloadErrFunction · 0.92
EvalMethod · 0.65
ResolveMethod · 0.65

Tested by

no test coverage detected