Go concurrency
Goroutines, channels, synchronization, cancellation, select, and production concurrency patterns.
Go Context: Cancellation, Deadlines, and Request Values
Learn Go context with practical cancellation, timeout, HTTP request, and goroutine examples.
Read tutorial Lesson 2 · Tutorial · Go 1.21+Go Mutex: Protecting Shared State from Race Conditions
A golang mutex tutorial that proves the race first, then teaches Lock/Unlock, RWMutex, the copy bug, atomics, and the frank mutex-vs-channel call.
Read tutorial Lesson 3 · Tutorial · Go 1.21+sync.WaitGroup in Go: Coordinating Multiple Goroutines
A tested golang waitgroup guide: the Add/Done/Wait counter model, the copy-by-value deadlock, the Add-inside-goroutine race, and Go 1.25's WaitGroup.Go.
Read tutorial Lesson 4 · Tutorial · Go 1.21+Go select Statement: Multiplexing Channels Explained
Learn Go's select statement with tested code: the random-choice rule, non-blocking default, timeouts, the nil-channel trick, and context cancellation.
Read tutorial Lesson 5 · Tutorial · Go 1.21+Go Worker Pool Pattern: Bounded Concurrency at Scale
Build a Go worker pool with tested code: bounded concurrency, error propagation, context cancellation, correct channel closing, and how to size the pool.
Read tutorial Lesson 6 · Tutorial · Go 1.21+Goroutines in Go: Concurrency Without Leaks
Learn how goroutines run, how to wait for them, propagate errors, cancel work, and prevent leaks.
Read tutorial Lesson 7 · Tutorial · Go 1.21+Go Channels: Communication Between Goroutines
Learn Go channels, buffering, closing, range, ownership, pipelines, and cancellation with practical examples.
Read tutorial Lesson 8 · Tutorial · Go 1.21+Goroutine Leaks in Go: How to Detect and Prevent Them
Detect and fix golang goroutine leaks with tested code: runtime.NumGoroutine, the pprof goroutine profile, go test leak checks, and per-cause fixes.
Read tutorial Lesson 9 · Tutorial · Go 1.21+Fan-Out Fan-In in Go: Parallel Work with Channels
Learn Go fan-out fan-in with tested code: parallelize work across workers, merge results, restore order, cancel on failure, and carry per-item errors.
Read tutorial Lesson 10 · Tutorial · Go 1.21+Go Channel Patterns: Advanced Recipes That Work
Advanced Go channel patterns with tested code and real output: or-done, tee, bridge, semaphores, heartbeats, and exactly when to reach for each.
Read tutorial Lesson 11 · Tutorial · Go 1.21+Go Concurrency Patterns: A Practical Catalogue
A tested catalogue of Go concurrency patterns: generator, fan-out, pipeline, worker pool, semaphore, or-done, and graceful shutdown, with use-when notes.
Read tutorial