Download for MacApple silicon, macOS 14+
Skill

golang-design-patterns

@samber Updated 2026-10-23

Idiomatic Golang design patterns — functional options, constructor APIs, `init()` and global-state avoidance, enums, panic vs error decisions, resource management and lifecycle, graceful shutdown, timeouts and retries, streaming and iterators, and architecture styles (clean, hexagonal, DDD, flat). Apply when 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. Not for wiring a DI container or comparing DI libraries (→ See `samber/cc-skills-golang@golang-dependency-injection` skill), nor for error wrapping, `errors.Is`/`As`, or logging mechanics (→ See `samber/cc-skills-golang@golang-error-handling` skill).

agentagent-skillsaiantigravityclaudeclaude-codecodecodex

Install

With your agent

Install OMGSkills skill "samber/cc-skills-golang:golang-design-patterns" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.

Manual command

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.