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

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

x/tools/cmd/godoc: multiword example tags #3070

gopherbot opened this issue Feb 19, 2012 · 9 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@gopherbot
Copy link
Contributor

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

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

rsc commented Mar 12, 2013

Comment 4:

[The time for maybe has passed.]

@adg
Copy link
Contributor

adg commented Mar 18, 2013

Comment 5:

Labels changed: added godoc.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 6:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 7:

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

@rsc
Copy link
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 cmd/godoc: multiword example tags 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
Copy link
Contributor

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

ping ?

@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 13, 2024
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

5 participants