Download for macOS
Skill

golang-design-patterns

@samber 39k installs Trending #412 on Skills.Sh Updated 2026-08-01

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.

agentagent-skillsaiantigravityclaudeclaude-codecodecodex

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.