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 · 7 comments
Milestone

Comments

@pjebs
Copy link
Contributor

@pjebs 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 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

@cagedmantis cagedmantis commented Jul 27, 2020

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

@pjebs
Copy link
Contributor Author

@pjebs 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

@davecheney davecheney commented Jul 28, 2020

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 icholy commented Jul 28, 2020

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

@josharian
Copy link
Contributor

@josharian josharian commented Jul 28, 2020

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 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

@cagedmantis cagedmantis commented Jul 29, 2020

/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.