package gen
Import Path
go.pact.im/x/plumb/internal/gen (on go.dev)
Dependency Relation
imports 13 packages, and imported by one package
Involved Source Files
Package gen is the orchestrator of plumb's pure core: it runs the discover →
solve → emit pipeline over loaded, type-checked packages to produce generated
injector source, performing no I/O, holding no global state, and consulting no
clock or randomness. Its output is a deterministic function of its inputs.
The phases live in sibling packages (discover, solve, emit) over shared leaves
(diag, gotypes); this package only wires them together.
Package-Level Type Names (only one, which is exported)
Options configures a single generation run. The cli builds it from flags; gen
distributes the fields each phase needs.
ImportPath is the destination package's import path. It decides what is
referenced unqualified (the destination) and what is imported and
qualified (everything else). Required and never empty by the time the
core runs.
OutputBase is the base name of the file being written (e.g.
"plumb_gen.go"), used to identify the file being overwritten for the
same-package function-name collision check. Empty when writing to stdout,
in which case that check is skipped.
PackageName is the identifier emitted in the generated `package <name>`
clause. Required and never empty by the time the core runs.
func Generate(opts Options, pkgs []*discover.Package) (*emit.Result, error)
func buildDestInfo(opts Options, pkgs []*discover.Package) (*solve.DestInfo, *diag.Error)
Package-Level Functions (total 3, in which 1 is exported)
Generate is the pure entry point: it analyzes the loaded packages, resolves
every set, and returns the generated source and report. It performs no I/O.
The returned error, when non-nil, is always a *diag.Error with a source
position where one applies.
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64)