Unraveling Go Anti-Patterns
summary
Recommends selective error wrapping using fmt %w and logging only useful context to avoid the measured CPU and memory overhead of excessive wrapping, uses error.Is and type assertions for comparisons instead of string matching, prefers returning errors over panic and shows using defer recover and os.Exit for graceful shutdown, advises strings.Builder and the stdlib strings package over + concatenation or custom joins for large workloads, and employs mutexes, context timeouts and a worker pool to limit goroutines and protect shared state.
AI-written summary · about
chapters (13)
- 0:00Go anti-patterns intro
- 1:50Error handling in Go
- 5:49Panic usage in Go
- 8:51Error comparison techniques
- 11:07String handling pitfalls
- 14:34Intermission
- 16:40String concatenation performance
- 18:11Concurrency and shared state
- 20:23Context cancellation
- 21:12Channels for sequential processes
- 22:22Global state risks
- 25:22Generics in production
- 28:15Final thoughts








