Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
codesuki
· 8y ago · 0 comments
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.
Comments
[–]
lobster_johnson
8y ago
It's in 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.