brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
golang-concurrencyWrite safe concurrent Go code with goroutines, channels, and context. Use when implementing concurrency with goroutines, channels, or context in Go.
Independent GitHub snapshot · Automated classification · Original documentation governs
ctx to manage cancellation, deadlines, and graceful termination.go test -race.errgroup.Group for parallel tasks with error propagation, channels for pipelines, sync.Mutex for simple shared state.sem := make(chan struct{}, maxWorkers)
for _, task := range tasks {
task := task // prevent loop pointer capture
sem <- struct{}{}
g.Go(func() error {
defer func() { <-sem }()
return task.Execute(ctx)
})
}
ctx.Done().go test -race in local dev and CI.See ErrGroup and concurrency patterns and context timeout examples
ctx.Done() or channel closure.&item) into a concurrent closure.errgroup or sync.WaitGroup for lifecycle tracking.