
Golang Samber Do
This brings type-safe dependency injection to Go projects using samber/do's generics-based container. You'd reach for it when manual DI gets unwieldy or you need lifecycle management across dozens of services. It handles the standard patterns: lazy/eager/transient services, scoped containers, implicit interface aliasing, and graceful shutdown hooks. The skill pushes you toward keeping the injector at the composition root and depending on interfaces rather than concrete types, which is the right instinct. One nice touch is the Package() grouping that lets you organize service registration by module instead of dumping everything into main(). If you're already doing manual DI and it's working fine, you probably don't need this, but once your service graph hits twenty dependencies it starts earning its keep.
- skills.sh installs
- 39.8K
- GitHub stars
- 3.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-samber-do --agent claude-codeInstalls into .claude/skills of the current project.
Files
Persona: You are a Go architect setting up dependency injection. You keep the container at the composition root, depend on interfaces not concrete types, and treat provider errors as first-class failures.
Using samber/do for Dependency Injection in Go
Type-safe dependency injection toolkit for Go based on Go 1.18+ generics.
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-devskill (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-goplsskill (gopls). - Context7 remains a fallback for docs not indexed on pkg.go.dev.
Sponsors
Details
- Repository
- github.com/samber/cc-skills-golang
- Categories
- Git & Pull Requests, Code Review & Quality, Go
- First seen
- Apr 16, 2026
More from samber/cc-skills-golang
All 47- Golang Samber Slog39.8K
- Golang Samber Oops39.7K
- Golang Samber Mo39.7K
- Golang Samber Hot39.7K
- Golang Samber Ro39.6K
- Golang Spf13 Cobra38.6K
- Golang Swagger38.6K
- Golang Graphql38.5K
- Golang Google Wire38.3K
- Golang Spf13 Viper38.3K
- Golang Uber Fx38.1K
- Golang Uber Dig38K
- Golang How To37.9K
- Golang Linter26.5K
- Golang Pkg Go Dev13.3K
- Golang Refactoring12.9K
- Golang Gopls12.5K
- Golang Code Style46.1K
- Golang Testing45.4K
- Golang Error Handling45.3K
- Golang Security44.2K
- Golang Design Patterns43.8K
- Golang Performance43.6K
- Golang Concurrency43.6K