Loading…
0+ curated questions with the same answer shape every time: quick recap, deep dive, pitfalls, and follow-ups. Coverage includes .
Advanced Go concurrency patterns are what separate Go developers who write working concurrent code from those who write safe, maintainable, production-grade concurrent code. This module covers the worker pool pattern (a fixed number of goroutines processing a job channel — how to size the pool, how to drain it cleanly on shutdown), the pipeline pattern (stages connected by channels, how to propagate cancellation through the pipeline), the semaphore pattern for capping concurrency (buffered channel as semaphore, the golang.org/x/sync/semaphore package), golang.org/x/sync/errgroup for running a group of goroutines and collecting the first error with cancellation, the singleflight pattern (deduplicating concurrent identical requests — critical for cache stampede prevention), and the done-channel pattern for signalling goroutine shutdown. Every pattern is presented as a problem first: 'you have 10,000 tasks and want to process with max 50 concurrent workers — how do you implement that safely in Go?'
Full catalog
Topics are ordered for learning. Within each topic, rows are numbered 1–0 globally so you always know where you are. Collapse topics if you want a lighter view — use Expand all when you need the full list again.
Numbers 1–0 follow the order we recommend — click any row to open the full answer, or use the sticky Next link at the bottom of each page to go Q1 → Q0.