Go Concurrency Goroutines

Guides goroutine lifetime and ownership — never start a goroutine you can't stop, give every goroutine a defined exit (context cancellation, a closed channel, or bounded work), avoid the blocked-forever leak, use sync.WaitGroup correctly (Add before the go, or wg.Go in 1.25) and golang.org/x/sync/errgroup for fallible fan-out and SetLimit worker pools, and keep library functions synchronous so the caller owns concurrency. Auto-invokes when writing or editing `go` statements, goroutines, sync.WaitGroup, errgroup, worker pools, or on "is this goroutine leaking" / "how do I wait for these" requests. The depth behind the policy root's "never start a goroutine you can't stop."

ctoth a952063 3 files · 33.7 KB Updated

File contents

ctoth/golang-skills-plugin/tree/main/plugins/golang/skills/go-concurrency-goroutines commit a95206346e

Frequently asked questions

npx skillmds@latest add ctoth/go-concurrency-goroutines