All Tools
D
Dev ToolsFreeOpen Source
DIG
Reflection-based dependency injection for Go
MIT
ABOUT
Go agent workers accumulate constructors for LLM clients, queues, and stores in main. Dig builds a typed graph at startup so those dependencies resolve in order. Use it to power a framework like Fx, not as a runtime service locator after the process is up.
INSTALL
go get go.uber.org/dig@v1INTEGRATION GUIDE
1. Resolve LLM, database, and queue clients when a Go worker starts
2. Power an application framework such as Uber Fx for inference services
3. Provide test fakes by swapping constructors in the Dig container
4. Keep startup wiring out of main without a custom DI container
TAGS
godependency-injectionuberdiconstructors