What problem does it solve?
This Skill helps you eliminate brittle, manual constructor wiring in Go by using samber/do to centralize dependency injection and lifecycle management so services start correctly and are easy to test.
Core Features & Use Cases
- Type-safe service registration: Register dependencies as interfaces with providers that return
(T, error), ensuring failures are handled where they occur.
- Correct lifecycle control: Use lazy (default), eager, and transient registrations to match startup requirements and per-request behavior.
- Production-ready container patterns: Organize modules with
do.Package, isolate per-request state with scopes, and integrate health checks and graceful shutdown through standard interfaces.
Quick Start
Tell your AI to install samber/do v2, create a do.New() container, register config/db/cache via do.Provide inside modular do.Package() blocks, and invoke services from the composition root with do.MustInvoke while implementing HealthCheck() and Shutdown() on cleanup-needed services.