MCPcopy
hub / github.com/uber-go/nilaway / fullTrigger

Method fullTrigger

inference/primitive.go:182–195  ·  view source on GitHub ↗

fullTrigger returns the primitive version of the full trigger.

(trigger annotation.FullTrigger)

Source from the content-addressed store, hash-verified

180
181// fullTrigger returns the primitive version of the full trigger.
182func (p *primitivizer) fullTrigger(trigger annotation.FullTrigger) primitiveFullTrigger {
183 // Expr is always nonnil, but our struct init analysis is capped at depth 1 so NilAway does not
184 // know this fact. Here, we explicitly guard against such cases to provide a hint.
185 if trigger.Consumer.Expr == nil {
186 panic(fmt.Sprintf("consume trigger %v has a nil Expr", trigger.Consumer))
187 }
188
189 producer, consumer := trigger.Prestrings(p.pass)
190 return primitiveFullTrigger{
191 Position: p.toPosition(trigger.Consumer.Expr.Pos()),
192 ProducerRepr: producer,
193 ConsumerRepr: consumer,
194 }
195}
196
197// site returns the primitive version of the annotation site.
198func (p *primitivizer) site(key annotation.Key, isDeep bool) primitiveSite {

Callers 1

Calls 3

toPositionMethod · 0.95
PrestringsMethod · 0.80
PosMethod · 0.45

Tested by

no test coverage detected