go-dependency-injection
Installation
SKILL.md
Go Dependency Injection
DI in Go is a pattern, not a framework: pass dependencies to
constructors, wire everything explicitly in main. Reach for a
framework only when manual wiring measurably hurts.
Community default. A project skill or agent-config rule that explicitly supersedes
go-dependency-injectiontakes precedence over this one.
1. Constructor Injection — the Default
// ✅ Good — dependencies are explicit parameters
type OrderService struct {
repo OrderRepository
payments PaymentGateway
logger *slog.Logger
}