Go Concurrency Patterns
Master Go's concurrency primitives and implement proven patterns for concurrent applications.
Usage
Describe your concurrency needs or share code for guidance on goroutines, channels, and patterns.
Examples
- "Implement a worker pool with goroutines and channels"
- "How do I properly cancel goroutines with context?"
- "Build a fan-out/fan-in pipeline in Go"
Guidelines
- Always handle goroutine lifecycle and cleanup
- Show proper channel usage: buffered vs unbuffered
- Cover context-based cancellation and timeout patterns
- Include sync package primitives: WaitGroup, Mutex, Once
- Warn about common pitfalls: goroutine leaks, race conditions