(needle, target ast.Expr)
| 679 | } |
| 680 | |
| 681 | func exprEqualsNeedle(needle, target ast.Expr) bool { |
| 682 | if needle.Kind() == ast.LiteralKind && target.Kind() == ast.LiteralKind { |
| 683 | return target.AsLiteral().Equal(needle.AsLiteral()) == types.True |
| 684 | } |
| 685 | if needle.Kind() == ast.IdentKind && target.Kind() == ast.IdentKind { |
| 686 | return target.AsIdent() == needle.AsIdent() |
| 687 | } |
| 688 | return false |
| 689 | } |
| 690 | |
| 691 | func collectionContainsNeedle(needle, haystack ast.Expr) bool { |
| 692 | if needle.Kind() != ast.LiteralKind && !isSelfEqualIdent(needle) { |
no test coverage detected