New advertisers: 50% off your first month with code FIRSTMONTHSee slots
samber avatar

Golang Samber Do

Dependency injection toolkit for Go using samber/do, covering containers, scopes, lifecycle, and module organization.

skills.sh installs
40.2K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers service containers, provider functions, scopes, health checks, graceful shutdown, and do.Package() module organization
  • Describes service types (lazy, eager, transient, value), named and implicit-alias registration, and struct injection with do.MustInvoke* helpers
  • Enforces container access only at the composition root and recommends do.MustInvoke* inside providers so panics convert back into errors
  • Designed for Go projects adopting samber/do v2 or refactoring manual constructor injection into a DI container

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-samber-do -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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-dev skill (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-gopls skill (gopls).
  • Context7 remains a fallback for docs not indexed on pkg.go.dev.

Details

Repository
github.com/samber/cc-skills-golang
Category
Go
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Samber Do

More Go