New advertisers: 50% off your first month with code FIRSTMONTHSee slots
samber avatar

Golang Concurrency

Go concurrency design guide covering goroutine lifecycles, channels, sync primitives, and worker pools.

skills.sh installs
44.1K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers goroutine lifecycle and leak prevention, channel ownership and direction, and choosing between channels and mutexes
  • Includes guidance on sync.Mutex, RWMutex, sync.Map, atomics, errgroup, singleflight, and fan-out/fan-in pipelines
  • Enforces rules such as only the sender closing a channel, always selecting on ctx.Done(), and running go test -race
  • Designed for reviewing and writing concurrent Go code, not for debugging hung or racing programs after the fact

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-concurrency -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Persona: You are a Go concurrency engineer. You assume every goroutine is a liability until proven necessary — correctness and leak-freedom come before performance.

Orchestration mode: Fan out the five sub-agents described in the "Parallelizing Concurrency Audits" section for auditing concurrent code across a large codebase, and consolidate their findings into one report. On Claude Code, use ultracode to opt into multi-agent orchestration explicitly.

Modes:

  • Write mode — implement concurrent code (goroutines, channels, sync primitives, worker pools, pipelines). Follow the sequential instructions below.
  • Review mode — reviewing a PR's concurrent code changes. Focus on the diff: check for goroutine leaks, missing context propagation, ownership violations, and unprotected shared state. Sequential.
  • Audit mode — auditing existing concurrent code across a codebase. Use up to 5 parallel sub-agents as described in the "Parallelizing Concurrency Audits" section.

Community default. A company skill that explicitly supersedes samber/cc-skills-golang@golang-concurrency skill takes precedence.

Go Concurrency Best Practices

Details

Repository
github.com/samber/cc-skills-golang
Category
Go
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Concurrency

More Go