The Things I Find Myself Repeating About Go
summary
Advice centers on concrete rules: prefer main.run pattern so the run function returns an error and becomes testable; initialize values once by default and use a keep to the left guard‑clause style to remove else blocks; push conditionals into named helpers (e.g. environment-based newThing, pointer helpers like Addr, JSON responder helpers) and prefer switch over nested if/else; wrap context.Canceled, status checks (use >399 not >=400) and deferred test evaluation to avoid consuming response bodies so tests remain reliable.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:27Naming in Go
- 9:58Avoiding if statements
- 14:28mainr run
- 20:08Helper functions in Go
- 28:21Design clarity in Go
- 30:48Summary








