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

x/tools/cmd/godoc: "const" declarations with type on right are not grouped with the type #9195

Open
bcmills opened this Issue Dec 2, 2014 · 4 comments

Comments

Projects
None yet
5 participants
@bcmills
Member

bcmills commented Dec 2, 2014

Run the godoc tool on a file such as http://play.golang.org/p/fnp9JT3Ki_.

The constants with types on the left of "=" are grouped with the type.  The
equivalent constants with types on the right are not.

Since the two styles of declaration produce equivalent constants, they should arguably
also produce equivalent documentation.
@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Dec 2, 2014

Comment 1:

Labels changed: added repo-tools, release-none.

@griesemer

This comment has been minimized.

Contributor

griesemer commented Dec 2, 2014

Comment 2:

Types are trivially recognizable in declarations of the form
const c T = x
That is not the case in general for declarations of the form
const c = x
(note that x may have a type).
We can probably use a heuristic to handle cases like
const c = T(x)
but the general case requires type-checking the package.
@bcmills

This comment has been minimized.

Member

bcmills commented Dec 2, 2014

Comment 3:

Even just the T(x) case would be a significant improvement.
@bcmills

This comment has been minimized.

Member

bcmills commented Dec 2, 2014

Comment 4:

(Also the related T{x} case if T is a struct type.)

@bcmills bcmills added new labels Dec 2, 2014

@bradfitz bradfitz removed the new label Dec 18, 2014

@griesemer griesemer added the godoc label Apr 1, 2015

@rsc rsc removed the godoc label Apr 10, 2015

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed the release-none label Apr 10, 2015

@rsc rsc changed the title from cmd/godoc: "const" declarations with type on right are not grouped with the type to x/tools/cmd/godoc: "const" declarations with type on right are not grouped with the type Apr 14, 2015

@rsc rsc removed the repo-tools label Apr 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment