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

Function recoverOriginalSource

policy/composer.go:108–120  ·  view source on GitHub ↗
(r *CompiledRule)

Source from the content-addressed store, hash-verified

106}
107
108func recoverOriginalSource(r *CompiledRule) cel.Source {
109 match := r.Matches()[0]
110 var source cel.Source
111 if match.Output() != nil {
112 source = match.Output().Expr().Source()
113 } else {
114 source = match.Condition().Source()
115 }
116 if rel, ok := source.(*RelativeSource); ok {
117 source = rel.Source
118 }
119 return source
120}
121
122type varIndex struct {
123 index int

Callers 1

ComposeMethod · 0.85

Calls 5

ExprMethod · 0.65
MatchesMethod · 0.45
OutputMethod · 0.45
SourceMethod · 0.45
ConditionMethod · 0.45

Tested by

no test coverage detected