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

Method lookupFunction

checker/env.go:238–245  ·  view source on GitHub ↗

lookupFunction returns a Decl proto for typeName as a function in env. Returns nil if no such function is found in env.

(name string)

Source from the content-addressed store, hash-verified

236// lookupFunction returns a Decl proto for typeName as a function in env.
237// Returns nil if no such function is found in env.
238func (e *Env) lookupFunction(name string) *decls.FunctionDecl {
239 for _, candidate := range e.container.ResolveCandidateNames(name) {
240 if fn := e.declarations.FindFunction(candidate); fn != nil {
241 return fn
242 }
243 }
244 return nil
245}
246
247// setFunction adds the function Decl to the Env.
248// Adds a function decl if one doesn't already exist, then adds all overloads from the Decl.

Callers 1

checkCallMethod · 0.80

Calls 2

ResolveCandidateNamesMethod · 0.80
FindFunctionMethod · 0.80

Tested by

no test coverage detected