New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Reflection-based DI container for Go with Provide/Invoke, named values, value groups, and interface binding.

skills.sh installs
38.4K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers Provide and Invoke, dig.In and dig.Out parameter and result objects, named values, value groups, and dig.As interface binding
  • Explains the container options DeferAcyclicVerification, RecoverFromPanics, and DryRun, plus optional and flattened group dependencies
  • Contrasts dig with fx, noting dig has no lifecycle hooks, module system, or signal-aware run loop
  • Designed for CLI tools, libraries, and test harnesses that need only the wiring graph, not a full service framework

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-uber-dig -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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-dev skill (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-gopls skill (gopls).
  • Context7 remains a fallback for docs not indexed on pkg.go.dev.
go get go.uber.org/dig

dig vs. fx

Details

Repository
github.com/samber/cc-skills-golang
Category
Go
First seen
May 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Uber Dig

More Go