I am using the go/ast
and go/parser
package to do something, but i am puzzled about the difference between Doc
and Comment
.
Is the first line of comments a Doc
, then others as Comment
?
Here is a sample:
TypeSpec struct {
Doc *CommentGroup // associated documentation; or nil
Name *Ident // type name
Type Expr // *Ident, *ParenExpr, *SelectorExpr, *StarExpr, or any of the *XxxTypes
Comment *CommentGroup // line comments; or nil
}