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
Labels
NeedsFix The path to resolution is known, but the work has not been done. pkgsite/dochtml Issues related to package documentation in pkgsite pkgsite

Comments

@jba
Copy link
Contributor

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.
@jba jba added NeedsFix The path to resolution is known, but the work has not been done. pkgsite labels Feb 2, 2021
@jba jba added this to the pkgsite/dochtml milestone Feb 2, 2021
@hyangah hyangah added the pkgsite/dochtml Issues related to package documentation in pkgsite label May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. pkgsite/dochtml Issues related to package documentation in pkgsite pkgsite
Projects
None yet
Development

No branches or pull requests

2 participants