[go-nuts] Re: fields of structs with particular comment using ast

2020-06-20 Thread Bebop Leaf
Generally, you are looking for a `*ast.GenDecl` and its doc, which contains a `ast.TypeSpec`, when it is written as `type Name Type{ ... }`. However, though nearly never happened, people can write it as `type ( Name Type{} )`, just like a `var` statement would. In that case, you are lookin

[go-nuts] Re: fields of structs with particular comment using ast

2020-06-20 Thread amarjeetanandsingh
Will try to explain with an example -- // expectedComment type StructNameA struct { NameA string AgeA int } // some diff comment type StructNameB struct { NameB string AgeB int } Now I want the name of StructNameA struct along with its fields because it contains expectedComment