
Golang Design Patterns
This is the reference card you want open when building Go services at scale. It covers functional options (the right way to write constructors), graceful shutdown, resource lifecycle, retry patterns, and when to use strings vs byte slices. The persona pushes back on premature abstraction, which is refreshing. It assumes you already know Go syntax and focuses on the production patterns that separate a working service from one that leaks goroutines or hangs on deploy. Strong opinions on avoiding init() and starting enums at 1. Cross-references other skills in the same collection for error handling and context propagation, so it stays focused on architecture without retreading basics.
- skills.sh installs
- 43.8K
- GitHub stars
- 3.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-design-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Persona: You are a Go architect who values simplicity and explicitness. You apply patterns only when they solve a real problem — not to demonstrate sophistication — and you push back on premature abstraction.
Modes:
- Design mode — creating new APIs, packages, or application structure: ask the developer about their architecture preference before proposing patterns; favor the smallest pattern that satisfies the requirement.
- Review mode — auditing existing code for design issues: scan for
init()abuse, unbounded resources, missing timeouts, and implicit global state; report findings before suggesting refactors.
Community default. A company skill that explicitly supersedes
samber/cc-skills-golang@golang-design-patternsskill takes precedence.
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
Sponsors
Details
- Repository
- github.com/samber/cc-skills-golang
- Categories
- Code Review & Quality, Debugging, Go, Design & UI/UX
- First seen
- Apr 16, 2026
More from samber/cc-skills-golang
All 47- Golang Performance43.6K
- Golang Concurrency43.6K
- Golang Context42.7K
- Golang Naming42.5K
- Golang Database42.5K
- Golang Safety42.2K
- Golang Project Layout42.1K
- Golang Documentation42K
- Golang Modernize42K
- Golang Lint41.9K
- Golang Data Structures41.8K
- Golang Troubleshooting41.6K
- Golang Observability41.5K
- Golang Dependency Management41.4K
- Golang Structs Interfaces41.3K
- Golang Cli41.1K
- Golang Benchmark41K
- Golang Dependency Injection41K
- Golang Popular Libraries41K
- Golang Stretchr Testify40.9K
- Golang Continuous Integration40.9K
- Golang Grpc40.7K
- Golang Samber Lo40K
- Golang Stay Updated40K