cmd/doc: show types for constants and variables that have initializers #33134
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Currently, if you ask
go doc
for an exported identifier, and it happens to be declared as avar
orconst
with the type inferred from the initializer, the type of the variable does not appear in the output.It is doubly frustrating if the initializer happens to refer to unexported identifiers, since
go doc
requires an extra flag before it will document those (#33133).What version of Go are you using (
go version
)?What did you do?
What did you expect to see?
The documentation for and type of the
go/build.ToolDir
variable.What did you see instead?
No indication of whether ToolDir is a
string
, a[]byte
, or something else entirely. It isn't mentioned in the doc comment, and it shouldn't need to be mentioned in the doc comment because the compiler already knows what it is.The text was updated successfully, but these errors were encountered: