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

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
Milestone

Comments

@bcmills
Copy link
Contributor

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
Copy link
Contributor

Comment 1:

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

@griesemer
Copy link
Contributor

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
Copy link
Contributor Author

bcmills commented Dec 2, 2014

Comment 3:

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

@bcmills
Copy link
Contributor Author

bcmills commented Dec 2, 2014

Comment 4:

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

@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 cmd/godoc: "const" declarations with type on right are not grouped with the type 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants