This document explains why a standard Go backend is structured the way it is and what belongs where.
api-go/
├── cmd/
│ └── server/
│ └── main.go
│
├── internal/
│ ├── routes/
│ ├── handlers/
│ ├── models/
│ ├── db/
│ └── middleware/
│
├── go.mod
└── go.sum
cmd/ — Runnable ApplicationsPurpose:
Contains all executable entry points.
Rules:
cmd/ builds one binary