
Golang Concurrency Patterns
Teaches Claude about production-ready Go concurrency patterns with explicit goroutine lifetimes, context-based cancellation, and proper state protection. You get practical guidance on errgroup for fan-out/fan-in, bounding concurrency with semaphores, and avoiding the classic failure modes like goroutine leaks and data races. The skill is opinionated in a good way, calling out anti-patterns like fire-and-forget goroutines in handlers and time.After in hot loops. It's passed audits from Gen Agent Trust Hub, Socket, and Snyk. Useful when you're building Go services and want Claude to suggest concurrent designs that won't bite you in production.
- skills.sh installs
- 420
- GitHub stars
- 79
- last updated
- Aug 21, 2026
Install
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill golang-concurrency-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Go Concurrency Patterns (Production)
Overview
Go concurrency scales when goroutine lifetimes are explicit, cancellation is propagated with context.Context, and shared state is protected (channels or locks). Apply these patterns to build reliable services and avoid common failure modes: goroutine leaks, deadlocks, and data races.
Quick Start
Default building blocks
- Use
contextto drive cancellation and deadlines. - Use
errgroup.WithContextfor fan-out/fan-in with early abort. - Bound concurrency (avoid unbounded goroutines) with a semaphore or worker pool.
- Prefer immutable data; otherwise protect shared state with a mutex or make a single goroutine the owner.
Avoid
- Fire-and-forget goroutines in request handlers.
time.Afterinside hot loops.- Closing channels from the receiver side.
- Sharing mutable variables across goroutines without synchronization.
Core Concepts
Goroutine lifecycle
Treat goroutines as resources with a clear owner and shutdown condition.
✅ Correct: stop goroutines via context
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Sponsors
Details
- Repository
- github.com/bobmatnyc/claude-mpm-skills
- Categories
- Backend & APIs, Go
- First seen
- Jun 3, 2026
More from bobmatnyc/claude-mpm-skills
All 158- Digitalocean Overview419
- Hono Validation419
- Digitalocean Networking415
- Digitalocean Storage414
- Golang Database Patterns414
- Openrouter413
- Digitalocean Managed Databases404
- Verification Before Completion401
- Test Driven Development400
- Better Auth Authentication398
- Kysely398
- Kubernetes397
- Json Data Handling394
- Systematic Debugging391
- Vue390
- Api Documentation389
- Screenshot389
- Software Patterns382
- Nextjs V16380
- Vercel Deployments Builds378
- Security Scanning377
- Test Quality Inspector376
- Svelte5 Runes Static373
- Stacked Prs371