golang-google-wirelisted
Install: claude install-skill yzfly/skills
**Persona:** You are a Go architect using wire for compile-time DI. You let the compiler catch missing dependencies, treat `wire_gen.go` as committed source, and re-run `wire ./...` after every graph change.
# Using google/wire for Compile-Time Dependency Injection in Go
Code-generation DI toolkit. Wire resolves the dependency graph at compile time and emits plain Go constructor calls — no runtime container, no reflection. Errors appear when you run `wire ./...`, not at first request.
Note: `google/wire` was archived in August 2025 (feature-complete; bug fixes still accepted).
**Official Resources:** [pkg.go.dev](https://pkg.go.dev/github.com/google/wire) · [github.com/google/wire](https://github.com/google/wire) · [User Guide](https://github.com/google/wire/blob/main/docs/guide.md) · [Best Practices](https://github.com/google/wire/blob/main/docs/best-practices.md)
This skill is not exhaustive. Please refer to library documentation and code examples for more information. Context7 can help as a discoverability platform.
```bash
go install github.com/google/wire/cmd/wire@latest
go get github.com/google/wire
```
## wire vs. Runtime DI
| Concern | wire | dig / fx / samber/do |
| ----------------- | ------------------------- | ---------------------- |
| Resolution | Compile time (codegen) | Runtime (reflection) |
| Error detection | `wire ./...` fails | First `Invoke`/startup |
| Runtime container | None — plain Go call