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: examples in external test packages are not runnable #62059
Comments
It doesn't look like any of the examples here are runnable either: Am I missing something? Are we sure the problem is related to the /v3 suffix? |
is it a difference between |
I believe @seankhliao is correct. The "v1" testable examples are in the For "v3", the testable examples were moved into the |
Thanks, unfortunately this has to go into our backlog, as we don't have resources to work on this right now. |
I think this may actually be a bug (or missing feature) in the Notice that doc.Examples is not able to create a "playable" example when the package ends in |
I noticed a similar issue on https://pkg.go.dev/github.com/keep94/sqroot/v2. The examples in this package don't have a run button even though the v2/example_test.go file is in the sqroot_test package and imports "github.com/keep94/sqroot/v2" However https://pkg.go.dev/github.com/keep94/sqroot, the v1 version, has runnable examples. |
What is the URL of the page with the issue?
https://pkg.go.dev/github.com/urfave/cli/v3@v3.0.0-alpha4#example-Command.Run-NoAction
This reports a bug that renders some testable examples without a
main
block, making them not runnable. It seems to happen anytime the import path ends with avN
major version suffix that doesn't match the package name.See the corresponding testable example code here and the import that ends in
/v3
here. Using an import alias that matches the package name resolves the issue. For example:What is your user agent?
Screenshot
What did you do?
Go to https://pkg.go.dev/github.com/urfave/cli/v3@v3.0.0-alpha4#example-Command.Run-NoAction and try to run the "NoAction" example (or any example for the
github.com/urfave/cli/v3
package).What did you expect to see?
A runnable code example with a
main
block and a "Run" button.What did you see instead?
A code example with no
main
block and no "Run" button.The text was updated successfully, but these errors were encountered: