Writing Better Go: Lessons from 10 Code Reviews
summary
Ten recurring code-review categories surface actual rules: handle errors explicitly, log or return, never both, wrap errors for context, avoid ambiguous result+error returns, prefer concrete types first then accept interfaces return concrete types, simplify concurrency with errgroup/waitgroup instead of fragile channels, use in-memory test helpers like MiniRedis or in-process gRPC fakes, declare vars close to use, favor flat control flow, and write comments that explain intent not implementation.
AI-written summary · about
chapters (12)
- 0:00Introduction and context
- 3:38Effective error handling
- 6:36Interfaces in Go
- 13:43Concurrency best practices
- 17:33Variable declaration patterns
- 20:34Preventing runtime panics
- 23:25Minimizing code complexity
- 24:49Organizing code structure
- 26:27Order and naming conventions
- 28:01Naming and documentation
- 30:22Conclusion and Q&A
- 34:00Q&A session
