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

Method Copy

checker/scopes.go:41–51  ·  view source on GitHub ↗

Copy creates a copy of the current Scopes values, including a copy of its parent if non-nil.

()

Source from the content-addressed store, hash-verified

39
40// Copy creates a copy of the current Scopes values, including a copy of its parent if non-nil.
41func (s *Scopes) Copy() *Scopes {
42 cpy := newScopes()
43 if s == nil {
44 return cpy
45 }
46 if s.parent != nil {
47 cpy.parent = s.parent.Copy()
48 }
49 cpy.scopes = s.scopes.copy()
50 return cpy
51}
52
53// Push creates a new Scopes value which references the current Scope as its parent.
54func (s *Scopes) Push() *Scopes {

Callers

nothing calls this directly

Calls 3

newScopesFunction · 0.85
CopyMethod · 0.65
copyMethod · 0.45

Tested by

no test coverage detected