golang-uber-dig
CommunityWire Go dependencies reliably with dig
Software Engineering#go#dependency injection#uber-go/dig#application wiring#dig.In#dig.Out#request scope
Authordashkan
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It eliminates brittle, manual construction of complex Go object graphs by letting you declaratively wire dependencies and have dig resolve them safely at composition time.
Core Features & Use Cases
- Lazy, memoized construction: Use constructors with
Provideso each dependency is built once per container and reused where needed. - Clean parameter/result wiring: Use
dig.In/dig.Outto manage many dependencies, including named values, value groups, and optional dependencies. - Disambiguation and interface exposure: Use
dig.Nameto select between multiple values of the same type anddig.Asto expose concrete implementations only through interfaces. - Graph validation and error clarity: Validate wiring early with
DryRun(true)and get dependency-path error messages whenInvokefails. - Scope-local composition: Create child scopes for request/tenant/module boundaries so per-request values don’t leak across concurrent executions.
- Testing-friendly DI: Build fresh containers per test, override providers via decoration, and validate graphs without running side-effecting constructors.
Quick Start
Use the golang-uber-dig skill to wire an HTTP service where many route constructors automatically contribute handlers into a routes group consumed by a single server constructor, ensuring missing providers fail at startup.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: golang-uber-dig Download link: https://github.com/dashkan/pivox/archive/main.zip#golang-uber-dig Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.