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

Method SetFunction

checker/scopes.go:112–114  ·  view source on GitHub ↗

SetFunction adds the function Decl to the current scope. Note: Any previous entry for a function in the current scope with the same name is overwritten.

(fn *decls.FunctionDecl)

Source from the content-addressed store, hash-verified

110// SetFunction adds the function Decl to the current scope.
111// Note: Any previous entry for a function in the current scope with the same name is overwritten.
112func (s *Scopes) SetFunction(fn *decls.FunctionDecl) {
113 s.scopes.functions[fn.Name()] = fn
114}
115
116// FindFunction finds the first function Decl with a matching name in Scopes.
117// The search is performed from innermost to outermost.

Callers 1

setFunctionMethod · 0.80

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected