The Go library's standard AST package[1] similarly stores comments and whitespace information. It has to, since it's used by gofmt, and you wouldn't be very happy you lost comments when formatting your code.
https://github.com/placeybordeaux/panic-attack
The package works fine, but I can't say it was fun to work with.