Skip to content

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

Open
@jba

Description

@jba

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.pkgsitepkgsite/dochtmlIssues related to package documentation in pkgsite

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions