3 ms·
Could you give a more complete example of how that works? I had a look at the `go/ast` package but couldn't find anything.
by codesuki 9y ago
Could you give a more complete example of how that works? I had a look at the `go/ast` package but couldn't find anything.
- lobster_johnson 9y agoIt's in ast.go (https://github.com/golang/go/blob/master/src/go/ast/ast.go https://github.com/golang/go/blob/master/src/go/ast/ast.go). Look how Node, Expr etc. are interfaces, with concrete struct implementations. The interfaces don't do much, only provide position information.