# uber-go/dig

A reflection based dependency injection toolkit for Go.

Repository: https://github.com/uber-go/dig
Canonical: https://ross.abutalabs.com/products/dig
Homepage: https://go.uber.org/dig
Language: Go
License: MIT
License Family: permissive
Topics: golang, go, dependency-injection, di
Last push: 2025-05-13T20:09:41+00:00

## Health v2 (maintenance only)
Score: 39/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 21, release rhythm 28, longevity 100
- inputs: {"age_days": 3452, "days_push": 477, "days_rel": 477, "gap_med": 35.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4497, forks 228 (observed 2026-08-28T04:08:51.421077+00:00)

## What it is
dig is a reflection-based dependency injection toolkit for Go that resolves object graphs at process startup. It is designed to power application frameworks like Uber's Fx rather than serve as a runtime service locator.

## Use cases
- wire up dependencies in a Go application
- resolve an object graph at startup
- build an application framework on top of DI
- manage constructor dependencies in Go services
- avoid manual dependency wiring in large Go codebases

## When to choose
- you need startup-time dependency injection in Go
- you're building or using an application framework like Fx
- you want a stable, SemVer-guaranteed v1 library

## When to avoid
- you need to resolve dependencies after the process has started
- you want a full application framework rather than a DI toolkit
- you plan to expose the container to user-land code as a service locator

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools, plugin-system
- domain: developer-tools, backend, apis
- platform: go, cross-platform
- tags: dependency-injection, reflection, object-graph, uber, service-locator-alternative

## Member repositories
- uber-go/dig (main) score 39

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:51.421077+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:27.016573+00:00, confidence not recorded.
  - readme: https://github.com/uber-go/dig (fetched 2026-08-28T04:08:51.421077+00:00, sha 9a1f2bdb2d65)
  - homepage: https://go.uber.org/dig (fetched 2026-08-29T09:06:31.687969+00:00, sha 4aad7164c395)
- Data as of 2026-08-30T08:39:29.467469+00:00.
