A FuncErrRetNonnilArg is a RichCheckEffect for a trusted function call `f(..., &v, ...)` whose final result is of type `error` and which, on success (`err == nil`), guarantees that the pointee `v` of a by-address argument is non-nil. The canonical example is `json.Unmarshal(data, &v)`: once the retu
| 112 | // pre-existing expression with its own (e.g., unassigned/nilable) producer, so on the error-is-nil |
| 113 | // branch we must actively *produce* a non-nil value for it, exactly as a `v != nil` check would. |
| 114 | type FuncErrRetNonnilArg struct { |
| 115 | root *RootAssertionNode // an associated root node |
| 116 | err TrackableExpr // the `error`-typed return of the function |
| 117 | arg TrackableExpr // the trackable pointee argument guaranteed non-nil on success |
| 118 | argExpr ast.Expr // the raw pointee expression, for producing a non-nil value |
| 119 | } |
| 120 | |
| 121 | func (f *FuncErrRetNonnilArg) isTriggeredBy(expr ast.Expr) bool { |
| 122 | return exprIsPositiveNilCheck(f.root, expr, f.err) |
nothing calls this directly
no outgoing calls
no test coverage detected