Go 1.27 or later; the declaration API uses generic methods.
git clone https://github.com/libtnb/wire.git
cd wire
go build ./cmd/wire
go test -race ./...
gofmt -l .
go vet ./...The suite runs in under a minute. The integration tests build the command
and run it against the fixture modules under internal/integration/testdata.
Fixtures commit their wire_gen.go. After a generator change, regenerate
them and review the diff:
go build -o /tmp/wire ./cmd/wire
for fixture in basic advanced scope rollback override_parent resolution unused_export nested_scope struct_binding; do
(cd internal/integration/testdata/$fixture && /tmp/wire generate .)
done
(cd internal/integration/testdata/modules && /tmp/wire generate ./...)
(cd internal/integration/testdata/private_type_shape && /tmp/wire generate ./...)- Branch from
main. - Add a fixture or unit test that fails without the change.
- Run
gofmt -l .,go vet ./..., andgo test -race ./.... - Add a line to the
Unreleasedsection ofCHANGELOG.mdfor user-visible changes. - Open a pull request.
- Every package and exported identifier has a doc comment that states intent and constraints, not a paraphrase of the signature.
- Rejected declarations are reported as
WIRE####diagnostics with a source position; new codes go intodocs/diagnostics.md. - Generated code stays free of dependencies on this module.
- Tests exercise behavior through the command or the generated code; there are no test-only hooks in production code.
Open a GitHub issue with go version,
wire version, the declaration that misbehaves, and the output you expected.