Production Go concurrency patterns — goroutines, channels, sync primitives, context, worker pools, pipelines, and graceful shutdown. Use when building concurrent Go applications or debugging race conditions.
- Concurrency Primitives — goroutines, channels, select, sync.Mutex, sync.WaitGroup, context.Context, errgroup.Group
- Worker Pool pattern with context cancellation
- Fan-Out / Fan-In Pipeline pattern
- errgroup with Cancellation and concurrency limits
- Bounded Concurrency (Semaphore) —
semaphore.Weightedand channel-based semaphore - Graceful Shutdown pattern with signal handling
- Concurrent Map —
sync.Mapand ShardedMap for different workloads - Select Patterns — timeout, non-blocking send/receive, priority select
- Race Detection —
go test -race,go build -race - Best Practices and common pitfalls
- Building concurrent Go applications
- Implementing worker pools and pipelines
- Managing goroutine lifecycles and cancellation
- Debugging race conditions
- Implementing graceful shutdown
npx add https://github.com/wpank/ai/tree/main/skills/backend/go-concurrencynpx clawhub@latest install go-concurrencyFrom your project root:
mkdir -p .cursor/skills
cp -r ~/.ai-skills/skills/backend/go-concurrency .cursor/skills/go-concurrencymkdir -p ~/.cursor/skills
cp -r ~/.ai-skills/skills/backend/go-concurrency ~/.cursor/skills/go-concurrencyFrom your project root:
mkdir -p .claude/skills
cp -r ~/.ai-skills/skills/backend/go-concurrency .claude/skills/go-concurrencymkdir -p ~/.claude/skills
cp -r ~/.ai-skills/skills/backend/go-concurrency ~/.claude/skills/go-concurrencyPart of the Backend skill category.