golang-uber-dig

Community

Wire Go dependencies reliably with dig

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 Provide so each dependency is built once per container and reused where needed.
  • Clean parameter/result wiring: Use dig.In/dig.Out to manage many dependencies, including named values, value groups, and optional dependencies.
  • Disambiguation and interface exposure: Use dig.Name to select between multiple values of the same type and dig.As to expose concrete implementations only through interfaces.
  • Graph validation and error clarity: Validate wiring early with DryRun(true) and get dependency-path error messages when Invoke fails.
  • 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 required

Components

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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.