I don't know if this is the only way, or the best way, but you can get all distinct types with the "golang.org/x/tools/go/loader" package. Here is an example, in the context of a code generator (greenpack) that produces serialization code:
https://github.com/glycerine/greenpack/blob/master/parse/getast.go#L95 which then calls getTypeSpecs() https://github.com/glycerine/greenpack/blob/master/parse/getast.go#L137 which is implemented here https://github.com/glycerine/greenpack/blob/master/parse/getast.go#L351 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/01a7cc1f-9335-4459-9714-2356ef54196an%40googlegroups.com.