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/pkgsite: example code should be displayed as package main when rendering #37291

Closed
fishy opened this issue Feb 19, 2020 · 3 comments
Closed
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@fishy
Copy link

fishy commented Feb 19, 2020

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/reddit/[email protected]/thriftclient?tab=doc#example-package

What did you expect to see?

On godoc.org, the Example* functions will be renamed to main when rendering, for example: https://godoc.org/github.com/reddit/baseplate.go/thriftclient#example-package

What did you see instead?

On pkg.go.dev we kept the original Example function name in the code.

@gopherbot gopherbot added this to the Unreleased milestone Feb 19, 2020
@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 19, 2020
@toothrot
Copy link
Contributor

/cc @julieqiu

@julieqiu
Copy link
Member

Thanks for reporting the bug, @fishy! We'll look into it.

/cc @dmitshur

@julieqiu julieqiu changed the title go.dev: Example functions are not renamed to main when rendering go.dev: example code should be displayed as package main when rendering Feb 19, 2020
@julieqiu julieqiu changed the title go.dev: example code should be displayed as package main when rendering x/pkgsite: example code should be displayed as package main when rendering Jun 15, 2020
@AceroM
Copy link

AceroM commented Aug 20, 2020

This issue was fixed in https://golang.org/cl/240685, and will be available soon on pkg.go.dev. It is currently behind the executable-examples experiment flag.

If you would like to test it out locally, you can run go run ./devtools/cmd/experiment create executable-examples.

The output should look like this:
image

@AceroM AceroM closed this as completed Aug 20, 2020
@golang golang locked and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants