No slash command · from fuse-go
Covers Go 1.27 concurrency: goroutines, channels, errgroup, context cancellation, race detection, and diagnosing goroutine leaks.
Ships in fuse-go. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Goroutines, channels, context, and errgroup for Go 1.27 — plus the number-one
documented pitfall: leaking goroutines on an unbuffered channel + early return.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
golang.org/x/sync/errgroup signaturesAfter implementation, run fuse-ai-pilot:sniper for validation, and run tests
with go test -race ./....
| Feature | Description |
|---|---|
| Goroutines & channels | Lightweight concurrency + typed communication |
| errgroup | Parallelism + error aggregation + context cancellation |
| context | First param, propagated strictly, carries cancellation/deadline |
| WaitGroup vs channels | Counting-only vs result/error passing |
| Race detector | -race in tests/CI to catch data races |
| Leak profile (GA 1.27) | pprof.Lookup("goroutineleak") / /debug/pprof/goroutineleak — no GOEXPERIMENT needed |
context.Context is the first parameter - named ctx, never stored in a structerrgroup for fan-out with errors - it handles wait + first error + cancel-race - a passing test without -race proves nothing about racesinternal/
├── fetch/
│ ├── fetch.go # errgroup.WithContext fan-out, bounded by SetLimit
│ └── worker.go # worker pool: fixed goroutines drain a jobs channel
└── pipeline/
└── stage.go # ctx-cancellable stages, buffered hand-off channels
→ See errgroup-patterns.md for full example
| Topic | Reference | When to Consult |
|---|---|---|
| Goroutines & channels | goroutines-channels.md | Buffered vs not, select, WaitGroup vs channels |
| errgroup | errgroup.md | Fan-out, error aggregation, SetLimit, TryGo |
| context | context-propagation.md | Cancellation, deadlines, propagation rules |
| Goroutine leaks | goroutine-leaks.md | The #1 pitfall + the goroutineleak profile (GA 1.27) |
| Template | When to Use |
|---|---|
| errgroup-patterns.md | Bounded parallel work with error handling |
| worker-pool.md | Fixed workers draining a job queue |
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(8) // bound concurrency
for _, u := range urls {
g.Go(func() error { return fetch(ctx, u) })
}
if err := g.Wait(); err != nil { // first non-nil error; cancels ctx
return err
}
→ See errgroup.md
ch := make(chan result, len(items)) // buffered → early return can't strand senders
→ See goroutine-leaks.md
ctx first and thread it through every blocking callerrgroup before hand-rolling WaitGroup + error channelsgo test -race; check the goroutineleak profile in CI (GA in 1.27; the
1.26 GOEXPERIMENT=goroutineleakprofile flag is deleted)context.Context in a struct fieldsync.WaitGroup when goroutines return errors (use errgroup)-race flagreferences/context-propagation.md (opens in a new tab)references/errgroup.md (opens in a new tab)references/goroutine-leaks.md (opens in a new tab)references/goroutines-channels.md (opens in a new tab)references/templates/errgroup-patterns.md (opens in a new tab)references/templates/worker-pool.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fusengine/claude-plugins --plugin fuse-go5 skills in this plugin
/go-architectureUse when laying out a new Go service, choosing an HTTP router or DB layer, or wiring dependencies. Not for concurrency (go-concurrency) or language idioms (go-core-idioms)./go-core-idiomsUse when writing or reviewing idiomatic sequential Go — error handling, slog logging, generics, interfaces, style. Not for concurrency (go-concurrency)./go-testing-qualityUse when writing or reviewing Go tests, adding coverage, benchmarking, or profiling a Go program. Not for CI/lint wiring (go-tooling-security) or non-Go tests.Other plugins' skills for the same job