cmd/doc: show documentation for explicitly-requested identifiers regardless of the -u
flag
#33133
Labels
Milestone
-u
flag
#33133
What version of Go are you using (
go version
)?What did you do?
What did you expect to see?
What did you see instead?
The
doc
command by default hides all unexported identifiers, even those explicitly requested by the user. To coax it to display the requested result, you have to pass the-u
flag, which has the secondary (and often unwanted) effect of displaying unexported fields and methods on the requested identifier.Moreover, that behavior is inconsistent with the behavior for
internal
packages, for whichgo doc
will happily display documentation even without the-u
flag.Instead, the
-u
flag should control only the behavior for nested declarations — variables, constants, types, functions, fields, and/or methods associated with the requested identifier — not the requested identifier itself.CC @robpike @mvdan @ianthehat
The text was updated successfully, but these errors were encountered: