(node *ast.Node)
| 1726 | type stringerPatcher struct{} |
| 1727 | |
| 1728 | func (p *stringerPatcher) Visit(node *ast.Node) { |
| 1729 | t := (*node).Type() |
| 1730 | if t == nil { |
| 1731 | return |
| 1732 | } |
| 1733 | if t.Implements(stringer) { |
| 1734 | ast.Patch(node, &ast.CallNode{ |
| 1735 | Callee: &ast.MemberNode{ |
| 1736 | Node: *node, |
| 1737 | Property: &ast.StringNode{Value: "String"}, |
| 1738 | }, |
| 1739 | }) |
| 1740 | } |
| 1741 | } |
| 1742 | |
| 1743 | func TestPatch(t *testing.T) { |
| 1744 | program, err := expr.Compile( |
nothing calls this directly
no test coverage detected