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: ExampleABC functions not matching a suffix rule are not displayed #10494

alandonovan opened this issue Apr 17, 2015 · 1 comment


Copy link

commented Apr 17, 2015

When viewing examples in godoc, a function called ExampleABC that doesn't match any of the suffix patterns described here

is silently excluded. I would have expected it to be associated with the package.

The -ex flag makes no difference.

You can see an example in the x/tools repo, if you sync to 9c57c19a58835b00c0e3e283952087842242e49b and look at The follow-up change, 41d9a0e7b2d60d52ef1caf232b081c16af220b44, renames the examples to make them visible.

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jun 3, 2015
@rsc rsc modified the milestones: Unplanned, Go1.6 Jan 13, 2016

This comment has been minimized.

Copy link

commented Feb 4, 2018

This seems to be intended functionality -

name := stripExampleSuffix(e.Name)
if name == "" || globals[name] {
	examples = append(examples, e)
} else if c.Verbose {
	log.Printf("skipping example 'Example%s' because '%s' is not a known function or type", e.Name, e.Name)

It strips the suffix and checks whether it matches with a global name or not. Do we want to remove it ?

@gopherbot gopherbot added the Tools label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.