go-concurrency
Go并发模式。路由到特定模式。
📖 中文导读:Go并发模式。路由到特定模式。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: go-concurrency description: Go concurrency patterns. Routes to specific patterns.
Concurrency
Route by Pattern
- Context cancellation → see context/
- Goroutine leaks → see goroutines/
- Channel patterns → see channels/
- Sync primitives → see sync/
Quick Check
- Every goroutine has exit path
- Context passed and checked
- Channels closed by sender only
- WaitGroup Add before go
Common Pitfalls
- Launching goroutines without shutdown mechanism
- Not propagating context through call chains
- Closing channels from receiver side
- Using WaitGroup counter incorrectly
Decision Tree
Need coordination? → Use context for cancellation
Need data flow? → Use channels
Need to wait? → Use sync.WaitGroup
Need mutual exclusion? → Use sync.Mutex