Skip to content

Commit

Permalink
Update Visitor-and-Patch.md (#369)
Browse files Browse the repository at this point in the history
Stringer example fixed.
  • Loading branch information
mdmcconnell authored May 9, 2023
1 parent c71396e commit cb1f345
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/Visitor-and-Patch.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func (p *patcher) Visit(node *ast.Node) {
}
```

Type information is also available. Here is an example, there all `fmt.Stringer`
interface automatically converted to `string` type.
Type information is also available. In the following example, any struct
implementing the `fmt.Stringer` interface is automatically converted to `string` type.

```go
func main() {
Expand Down Expand Up @@ -136,6 +136,7 @@ func (p *stringerPatcher) Visit(node *ast.Node) {
Callee: &ast.MemberNode{
Node: *node,
Field: "String",
Property: &ast.StringNode{Value: "String"},
},
})
}
Expand Down

0 comments on commit cb1f345

Please sign in to comment.