How I structure my Golang projects
How I structure my Golang projects
COM
HOW TO STRUCTURE
YOUR BACKEND
FOR GOLANG
DEVS
BY DANIEL MESQUITA
01
Introduction
Building maintainable, scalable Go
applications often starts with a solid
project structure.
DANIELMESQUITTA.COM
02
My project structure
cmd: contains the main.go
entry point for your
application
docs: API documentation
internal: holds the
application code (business
logic, handlers, etc.)
test: integration tests and
test configuration
tmp: temporary files (e.g.,
binaries generated by Air)
DANIELMESQUITTA.COM
03
DANIELMESQUITTA.COM
04
DANIELMESQUITTA.COM
05
DANIELMESQUITTA.COM
06
DANIELMESQUITTA.COM
07
Final words
This project structure reflects what I’ve
learned over time and what has worked
well for my teammates and me. Think of
it as inspiration, not the absolute truth.
DANIELMESQUITTA.COM
DONT FORGET TO
LIKE, SHARE AND
SAVE IF YOU LIKE
THIS POST
DANIEL MESQUITA