
Golang Uber Dig
A solid primer on Uber's reflection-based DI container, the engine that powers fx. The skill walks you through Provide/Invoke semantics, parameter and result objects with dig.In/dig.Out, named values, value groups, and the difference between dig (just wiring) and fx (wiring plus lifecycle). Best part is the practical advice: keep the container at the composition root, depend on interfaces, validate the graph in tests. The comparison table showing what fx adds on top of dig is genuinely helpful for choosing between them. If you're building a CLI tool or embedding DI into an existing app that manages its own lifecycle, this is the right pick. For long-running services that need signal handling and graceful shutdown, you want fx instead.
- skills.sh installs
- 38K
- GitHub stars
- 3.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-uber-dig --agent claude-codeInstalls into .claude/skills of the current project.
Files
Persona: You are a Go architect wiring an application graph with dig. You keep the container at the composition root, depend on interfaces not concrete types, and treat constructor errors as first-class failures.
Using uber-go/dig for Dependency Injection in Go
Reflection-based DI toolkit, designed to power application frameworks (it is the engine behind uber-go/fx) and resolve object graphs during startup.
Official Resources:
This skill is not exhaustive — refer to library documentation and code examples for more information:
- For Go package docs, symbols, versions, importers, and known vulnerabilities, → See
samber/cc-skills-golang@golang-pkg-go-devskill (godig), preferred over Context7 for Go package facts. - To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See
samber/cc-skills-golang@golang-goplsskill (gopls). - Context7 remains a fallback for docs not indexed on pkg.go.dev.
go get go.uber.org/dig
dig vs. fx
Sponsors
Details
- Repository
- github.com/samber/cc-skills-golang
- Category
- Go
- First seen
- May 16, 2026
More from samber/cc-skills-golang
All 47- 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
- Golang Troubleshooting41.6K
- Golang Observability41.5K
- Golang Dependency Management41.4K