golang-design-patterns
Idiomatic Golang design patterns — functional options, constructors, error flow and cascading, resource management and lifecycle, graceful shutdown, resilience, architecture, dependency injection, data handling, streaming, and more. Apply when explicitly choosing between architectural patterns, implementing functional options, designing constructor APIs, setting up graceful shutdown, applying resilience patterns, or asking which idiomatic Go pattern fits a specific problem.
Install
git clone https://github.com/samber/cc-skills-golang /tmp/cc-skills-golang && ln -s /tmp/cc-skills-golang/skills/golang-design-patterns ~/.claude/skills/golang-design-patterns
From README
Go Design Patterns & Idioms Idiomatic Go patterns for production-ready code. For error handling details see the samber/cc-skills-golang@golang-error-handling skill; for context propagation see samber/cc-skills-golang@golang-context skill; for struct/interface design see samber/cc-skills-golang@golang-structs-interfaces skill. Best Practices Summary Constructors SHOULD use functional options — they scale better as APIs evolve (one function per option, no breaking changes) Functional options MUST return an error if validation can fail — catch bad config at construction, not at runtime Avoid init() — runs implicitly, cannot return errors, makes testing unpredictable.
More from this repo
golang-google-wire
Compile-time dependency injection in Golang using google/wire — wire.NewSet, wire.Build, wire.Bind...
golang-gopls
Golang semantic code intelligence via `gopls`, the official Go language server — go-to-definition, find references,...
golang-how-to
Golang skills orchestrator — always active on any Golang coding, review, debug, or setup task.
