MCPcopy Index your code
hub / github.com/uber-go/nilaway / RichCheckFromNode

Function RichCheckFromNode

assertion/function/assertiontree/rich_check_effect.go:253–263  ·  view source on GitHub ↗

RichCheckFromNode analyzes the passed `ast.Node` to see if it generates a rich check effect. If it does, that effect is returned along with the boolean true If it does not, then `nil, false` is returned.

(rootNode *RootAssertionNode, nonceGenerator *guard.NonceGenerator, node ast.Node)

Source from the content-addressed store, hash-verified

251// If it does, that effect is returned along with the boolean true
252// If it does not, then `nil, false` is returned.
253func RichCheckFromNode(rootNode *RootAssertionNode, nonceGenerator *guard.NonceGenerator, node ast.Node) ([]RichCheckEffect, bool) {
254 var effects []RichCheckEffect
255 someEffects := false
256 if okReadEffects, ok := NodeTriggersOkRead(rootNode, nonceGenerator, node); ok {
257 effects, someEffects = append(effects, okReadEffects...), true
258 }
259 if funcEffects, ok := NodeTriggersFuncErrRet(rootNode, nonceGenerator, node); ok {
260 effects, someEffects = append(effects, funcEffects...), true
261 }
262 return effects, someEffects
263}
264
265// parseExpr wraps a call to ParseExprAsProducer with two additional bits of useful handling:
266// 1. check for the empty expression and return nil when passed it

Callers 1

Calls 2

NodeTriggersOkReadFunction · 0.85
NodeTriggersFuncErrRetFunction · 0.85

Tested by

no test coverage detected