(pass *analysishelper.EnhancedPass)
| 64 | } |
| 65 | |
| 66 | func (t *FullTrigger) truncatedProducerPos(pass *analysishelper.EnhancedPass) token.Position { |
| 67 | // Our struct init analysis only tracks fields for depth 1 and relies on escape analysis for |
| 68 | // escaped fields (t.Producer.Expr here). Since there are functions that return nil producers |
| 69 | // (although they were never assigned to [FullTrigger.Producer]), NilAway concluded that |
| 70 | // [ProduceTrigger.Expr] must be nilable. Therefore, we add a redundant check here to guard |
| 71 | // against such cases and make NilAway happy. |
| 72 | // TODO: remove this redundant check . |
| 73 | if t.Producer.Expr == nil { |
| 74 | panic(fmt.Sprintf("nil Expr for producer %q", t.Producer)) |
| 75 | } |
| 76 | return pass.PosToLocation(t.Producer.Expr.Pos()) |
| 77 | } |
| 78 | |
| 79 | // equals returns true if the two passed FullTriggers are equal, and false otherwise. |
| 80 | func (t *FullTrigger) equals(other FullTrigger) bool { |
no test coverage detected