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: multiword example tags #3070

Open
gopherbot opened this Issue Feb 19, 2012 · 9 comments

Comments

Projects
None yet
4 participants
@gopherbot

gopherbot commented Feb 19, 2012

by trolleriprofessorn:

Godoc currently only handles example functions with single word suffixes. It would be
nice if a test function named ExampleF_foo_bar generated an example with the heading
"F (Foo bar)".

Which revision are you using?  824c981ccd14
@rsc

This comment has been minimized.

Contributor

rsc commented Feb 19, 2012

Comment 1:

I am not sure we really want people writings sentences as identifiers.
You can write a doc comment and godoc will show it as explanatory text.

Labels changed: added priority-later, removed priority-triage.

Owner changed to @adg.

Status changed to Accepted.

@gopherbot

This comment has been minimized.

gopherbot commented Feb 19, 2012

Comment 2 by trolleriprofessorn:

Yes, it's a bit weird that the method name is transformed into a heading in
the documentation. Perhaps another mechanism for creating the headings
would be better.
@rsc

This comment has been minimized.

Contributor

rsc commented Mar 12, 2013

Comment 4:

[The time for maybe has passed.]
@adg

This comment has been minimized.

Contributor

adg commented Mar 18, 2013

Comment 5:

Labels changed: added godoc.

@rsc

This comment has been minimized.

Contributor

rsc commented Nov 27, 2013

Comment 6:

Labels changed: added go1.3maybe.

@rsc

This comment has been minimized.

Contributor

rsc commented Dec 4, 2013

Comment 7:

Labels changed: added release-none, removed go1.3maybe.

@rsc

This comment has been minimized.

Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added repo-tools.

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

@rsc rsc changed the title from cmd/godoc: multiword example tags to x/tools/cmd/godoc: multiword example tags Apr 14, 2015

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

@adg adg removed their assignment May 27, 2016

@agnivade

This comment has been minimized.

Member

agnivade commented May 3, 2018

Currently, godoc ignores example functions if their suffixes contain _ as it messes up with the example association logic with its corresponding function/type/method.

Although the logic can be extended to support suffixes containing '_', I don't see much value in this. The use of _ is very clear in demarcating boundaries between methods on a type and the suffix (for eg. ExampleT_M_suffix and ExampleT_suffix). We have been doing fine with single word suffixes using CamelCase for extra distinction (ExampleT_M_suffixAnother).

And given that it has remained dormant for 5 years, I doubt there is any need for it. Thoughts @bradfitz / @andybons ?

@agnivade

This comment has been minimized.

Member

agnivade commented May 31, 2018

ping ?

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