Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/doc: Go 1.5 "go doc" and const block #11705

Closed
pierrre opened this issue Jul 14, 2015 · 2 comments
Closed

cmd/doc: Go 1.5 "go doc" and const block #11705

pierrre opened this issue Jul 14, 2015 · 2 comments
Milestone

Comments

@pierrre
Copy link

pierrre commented Jul 14, 2015

In Go 1.5, the new go doc command only shows the first exported constant of a "const" block.

Running go doc on

const (
    Foo = "foo"
    Bar = "bar"
)

const (
    Baz = "baz"
    Buz = "buz"
)

Prints:

package godoc // import "_test/godoc"

const Foo = "foo" ...
const Baz = "baz" ...

In know go help doc says:

Doc prints the documentation comments associated with the item identified by its
arguments (a package, const, func, type, var, or method) followed by a one-line
summary of each of the first-level items "under" that item (package-level declarations
for a package, methods for a type, etc.).

but it's misleading.

@dsnet
Copy link
Member

dsnet commented Aug 24, 2015

This may be personal preference, but I personally like the fact that the tool doesn't dump a huge list of constants.

@robpike
Copy link
Contributor

robpike commented Aug 24, 2015

Working as intended.

@robpike robpike closed this as completed Aug 24, 2015
@golang golang locked and limited conversation to collaborators Aug 24, 2016
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants