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, x/pkgsite: package-scope exported variables display full source code of function bodies #40360

Open
pjebs opened this issue Jul 23, 2020 · 8 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@pjebs
Copy link
Contributor

pjebs commented Jul 23, 2020

For my package: https://github.com/rocketlaunchr/dataframe-go, the godoc page for Variables of func is ridiculous.

It is so ridiculous, I can't explain it in words here.

See: https://godoc.org/github.com/rocketlaunchr/dataframe-go/forecast/evaluation

/cc @dmitshur

@pjebs pjebs changed the title go/doc: Display of Variables is ridiculous go/doc: Display of Variables of func is ridiculous Jul 23, 2020
@icholy
Copy link

icholy commented Jul 24, 2020

Why are those variables instead of functions? Assuming there is a reason, you can do this https://play.golang.org/p/TQsCdJPm2tB

@cagedmantis
Copy link
Contributor

Could you please provide an example or an explanation of what you expected to see on the documentation page?

@cagedmantis cagedmantis added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jul 27, 2020
@pjebs
Copy link
Contributor Author

pjebs commented Jul 28, 2020

I don't know how to improve the formatting but i'm sure the current state is ugly and too verbose.

@davecheney
Copy link
Contributor

Rather than changing the tooling, ISTM that the offending variable could be rewritten as a function and that would solve the issue.

@icholy
Copy link

icholy commented Jul 28, 2020

@pjebs the docs are ugly because your code is ugly.

@josharian
Copy link
Contributor

I would ask everyone to tone down the rhetoric, please.

One possible solution is for godoc not to print function bodies. It could replace them with (say) /* body omitted */, much as unexported struct fields are omitted. (And the full contents could be shown in m=all mode, again like struct fields.)

@cagedmantis cagedmantis added this to the Backlog milestone Jul 28, 2020
@cagedmantis cagedmantis added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jul 28, 2020
@cagedmantis cagedmantis changed the title go/doc: Display of Variables of func is ridiculous cmd/godoc: Display of Variables of func is ridiculous Jul 29, 2020
@cagedmantis
Copy link
Contributor

/cc @dmitshur

@dmitshur dmitshur changed the title cmd/godoc: Display of Variables of func is ridiculous x/tools/cmd/godoc, x/pkgsite: package-scope exported variables display full source code of function bodies Jul 29, 2020
@adonovan
Copy link
Member

This bug is still present in pkgsite:

https://pkg.go.dev/github.com/rocketlaunchr/dataframe-go/forecast/evaluation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants