golang-dependency-injection
Comprehensive guide for dependency injection (DI) in Golang. Covers why DI matters (testability, loose coupling, separation of concerns, lifecycle management), manual constructor injection, and DI library comparison (google/wire, uber-go/dig, uber-go/fx, samber/do). Use this skill when designing service architecture, setting up dependency injection, refactoring tightly coupled code, managing singletons or service…
- installs 8w
- 4,219
- 30-day movement
- starts with the next reading
- Related entries
- 1
- Connections
- 0
An agent skill that guides dependency injection in Go: why DI matters, manual constructor injection, and a comparison of google/wire, uber-go/dig, uber-go/fx, and samber/do. It bundles reference files on manual DI and each library, plus sections on testing, pitfalls, and when to adopt a DI library.
Reach for it when designing service architecture or wiring dependencies in Go and you need to choose between manual DI and a library.
Use it to
- Decide between manual constructor injection and a DI library
- Refactor tightly coupled Go code toward injected dependencies
- Compare wire, dig, fx, and samber/do for a project
- Set up mock injection for testing services
- Avoid common DI mistakes like globals or init() wiring
For Go developers designing service wiring and architecture
- Host repository
- samber/cc-skills-golang
- Version
- 1.3.1
- Installs, lifetime
- 38k
- Installs, 8 weeks
- 4,219
- Compatible with
- Designed for Claude Code, Codex or similar harness, and for projects using Golang.
- Licence
- MIT
- Invocable by
- user
- Host stars
- 3,261
- Host language
- Go