
Golang Google Wire
Google Wire does compile-time dependency injection for Go through code generation instead of runtime reflection. You write providers (regular Go functions), group them into sets with wire.NewSet, then declare an injector function tagged with //go:build wireinject. Running wire generates wire_gen.go with plain constructor calls, so missing dependencies fail at codegen, not when your app boots. Interface bindings must be explicit via wire.Bind, which prevents ambiguity when multiple types satisfy the same interface. The project was archived in August 2025 as feature-complete. Good fit if you want compile-time safety and zero runtime overhead; use dig or fx instead if you need lifecycle hooks or lazy initialization.
- skills.sh installs
- 38.3K
- GitHub stars
- 3.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-google-wire --agent claude-codeInstalls into .claude/skills of the current project.
Files
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.
Dependencies:
- wire:
go install github.com/google/wire/cmd/wire@latest
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 · github.com/google/wire · User Guide · Best Practices
This skill is not exhaustive — refer to library documentation and code examples for more information:
Sponsors
Details
- Repository
- github.com/samber/cc-skills-golang
- Categories
- DevOps & CI/CD, Git & Pull Requests, Go
- First seen
- May 16, 2026
More from samber/cc-skills-golang
All 47- Golang Spf13 Viper38.3K
- Golang Uber Fx38.1K
- Golang Uber Dig38K
- Golang How To37.9K
- Golang Linter26.5K
- Golang Pkg Go Dev13.3K
- Golang Refactoring12.9K
- Golang Gopls12.5K
- Golang Code Style46.1K
- Golang Testing45.4K
- Golang Error Handling45.3K
- Golang Security44.2K
- Golang Design Patterns43.8K
- Golang Performance43.6K
- Golang Concurrency43.6K
- Golang Context42.7K
- Golang Naming42.5K
- Golang Database42.5K
- Golang Safety42.2K
- Golang Project Layout42.1K
- Golang Documentation42K
- Golang Modernize42K
- Golang Lint41.9K
- Golang Data Structures41.8K