AI Snips
Chapters
Transcript
Episode notes
No Circular Imports Forces Better Architecture
- Go’s no-circular-dependencies rule strongly shapes package layout and encourages dependency flow in one direction.
- Ben Johnson recommends placing domain objects in the root so other packages depend on domain interfaces rather than each other.
Start Single Then Split When Needed
- Start with a single package for apps and split packages only when clear boundaries emerge.
- Chris Brando and Ben both advise merging packages instead of creating many tiny ones to avoid future refactor pain.
Split Large Files Without Splitting Types
- Break very large files into meaningful units but keep related types and methods together in one file.
- Chris James suggests simple PartOne.go/PartTwo.go splits; avoid splitting a single type across files to reduce cognitive load.


