Repository navigation
Wire v1.3.0 fixes stale generation in multi-module workspaces and adds opt-in support for project-owned generation commands.
Go version requirement
Go 1.25 or later is required. The v1.2.0 module declared Go 1.19. The updated golang.org/x/tools, x/mod, x/sync, and x/sys dependencies require Go 1.25.0, so update local and CI toolchains before upgrading the Wire module or generator.
Existing provider APIs and the default generation command are preserved. The generation-command override is opt-in.
Fixed: stale provider signatures in workspace generation
After the caches were fully warm, generating multiple targets from a separate tooling module could report unchanged after a provider refactor while leaving calls to deleted types or old constructor signatures in wire_gen.go.
Wire now retains module identities and fingerprints mutable source files in sibling workspace modules and filesystem replacements. Both mtime and content modes detect these edits while retaining warm-cache reuse. Regression tests compile the regenerated targets and check that a newly missing dependency produces an error instead of cached success.
Fixes #14 through #27. Thanks to @Satont for the detailed report and cache diagnosis.
Added: custom generation commands
-generate_command is available on gen, diff, and watch. Projects can use a Go tool dependency to generate workspace-compatible directives:
go get -tool github.com/goforj/wire/cmd/wire@v1.3.0
go tool wire gen -generate_command="go tool wire" ./...The generated directive preserves that choice on subsequent runs:
//go:generate go tool wire gen -generate_command "go tool wire"Custom prefixes follow go generate quoting and environment-expansion rules. Wrapper commands must forward the generated arguments. Build tags and the command override are retained when regenerating, and output-cache keys distinguish different command prefixes.
Addresses #15 through #26. Thanks to @termermc for the request.
Dependency and repository maintenance
- Update
github.com/fsnotify/fsnotifyfrom v1.7.0 to v1.10.1 andgithub.com/google/go-cmpfrom v0.6.0 to v0.7.0. - Update
golang.org/x/toolsto v0.49.0,x/modto v0.40.0,x/syncto v0.22.0, andx/systo v0.47.0. - Add dependency review, vulnerability/SBOM checks, and secret scanning; refresh pinned workflow actions.
- Batch routine Dependabot version updates monthly.
- Improve the development Makefile, documentation, and README artwork links.
Install
go install github.com/goforj/wire/cmd/wire@v1.3.0