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: include needed init methods in playable examples #44076

Open
jba opened this issue Feb 2, 2021 · 0 comments
Open

x/pkgsite: include needed init methods in playable examples #44076

jba opened this issue Feb 2, 2021 · 0 comments

Comments

@jba
Copy link
Contributor

@jba jba commented Feb 2, 2021

An example may depend on an init function. When creating a playable example (standalone program) from an example, we currently do not include init functions, so such examples won't run correctly.

Example: https://pkg.go.dev/gonum.org/v1/gonum/graph/community#example-Profile-Multiplex

Challenges:

  • We only want to include the init function if it affects the example, so we have to walk its body to check.
  • A relevant init function can be in any file in the test package, and we only examine one file at a time at present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant