-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What version of Go are you using (go version
)?
1.11
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
darwin
Question
Noticed in the AST for type instantiated structures, that if I go to the Doc
field in ast.TypeSpec
the value is nil
. I have to visit the ast.GenDecl
node instead to grab doc fields.
Is this intended?
If so, why does ast.TypeSpec
have a Doc
field? Should Doc
along with Comment
be deprecated, as in mentioned in the docs, since comments/documentation really do not have anything to do with the type specification?
This can reproduce by parsing the code sample below
package foo
// documentation goes here
type Foo struct{}
func main() {
f := Foo{}
}
expectation
ast.TypeSpec
contain non-nil
value for Doc
when documentation is provided.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.