Note
This repository is a fork of google/wire, maintained by verystar. It is intended for internal use by the VeryStar team only; external projects should depend on the upstream google/wire or another community fork instead. The upstream project is no longer maintained; this fork continues maintenance with a focus on Go toolchain compatibility and bug fixes.
The module path is github.com/verystar/wire. Existing internal projects
can adopt this fork without changing their imports:
go mod edit -replace=github.com/google/wire=github.com/verystar/wire@latestWire is a code generation tool that automates connecting components using dependency injection. Dependencies between components are represented in Wire as function parameters, encouraging explicit initialization instead of global variables. Because Wire operates without runtime state or reflection, code written to be used with Wire is useful even for hand-written initialization.
For an overview, see the introductory blog post.
Install Wire by running:
go install github.com/verystar/wire/cmd/wire@latestand ensuring that $GOPATH/bin is added to your $PATH.
This fork follows a preserve, not extend policy: wire's core invariant —
dependency identity is Go type identity (types.Identical) — is kept
unchanged, and no new feature surface is planned. Maintenance is limited to
compatibility with new Go releases and bug fixes.
Diverges from upstream google/wire so far:
- Module path renamed to
github.com/verystar/wire(imports and the generated//go:generatedirective point to this fork).
For questions, please use GitHub Discussions.
This project is covered by the Go Code of Conduct.