How Do You Structure Your Go Apps?
summary
Compares concrete layouts and tradeoffs: a flat structure avoids circular deps and suits small apps; MVC/layered grouping causes circular dependencies and confusing models; module-by-domain and DDD by bounded contexts remove globals and clarify language; hexagonal architecture forces inward-only dependencies via interfaces so storage and HTTP adapters swap easily; recommends CMD/pkg binaries, put tests next to code, avoid init for sample data, prefer explicit sample resources, and warns about naming, globals, and large util packages.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:07The importance of structure
- 4:33Defining a good structure
- 8:23Flat structure approach
- 10:34Layered architecture (MVC)
- 14:28Grouping by modules
- 15:25Domain driven design
- 23:51Hexagonal architecture
- 29:45Structuring tips and testing
- 35:11Summary and conclusion
- 39:46Q&A session
related talks
44mHow Do You Structure Your Go Apps?
18mAchieving maintainability with hexagonal architecture
30mFrom Chaos to Domain Driven Design
51mArchitecture in Go and What Rust Has to Do with It
42mFrom Chaos to Domain Driven Design in Go
33mProject layout patterns in Go
33mClean Up Your GOOOP: How to Break OOP Muscle Memory
01h 02mKeeping it Simple With Go
