Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Forge Go Concurrency?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-forge-go-concurrency)
---
name: forge-go-concurrency
description: Write safe Go concurrency with contexts, errgroup, bounded worker pools, channels that close and the race detector
---
<!-- Generated from catalog/skills/go-concurrency/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->
# Go concurrency
Use in Go code that starts goroutines.
## Lifecycle
- Every goroutine has a clear owner and exit path; pass `context.Context` and stop on `ctx.Done()`.
- Use `errgroup.WithContext` for fan-out with error propagation; bound parallelism with `SetLimit`.
## Channels and state
- The sender closes channels; never close from the receiver.
- Protect shared state with `sync.Mutex` or confine it to one goroutine; no unsynchronized map writes.
## Pitfalls
- Loop variable capture is fixed in Go 1.22+, but check the module's go version.
- Don't leak goroutines blocked on channels nobody reads; use buffered channels or select with ctx.
## Verify
`go test -race ./...` passes, and a test cancels the context mid-work and asserts all goroutines exit (e.g. with `goleak`).