Skip to content
All posts

Structuring a Go Monorepo

cmd/, internal/, and a go.work file: the layout we use to keep five services and three libraries sane in one repository.

Kampala Gophers Team3 min read

We keep every service under cmd/ and shared code under internal/, which the compiler refuses to let other modules import.

main.go
// go.work
go 1.23

use (
	./services/payments
	./services/notifications
	./libs/momo
)

Rules we follow

  • One main package per binary
  • No package named utils
  • Interfaces live next to the code that uses them

// Weekly Intel

Get the next post in your inbox

Event updates and the occasional Go deep-dive. No spam, unsubscribe any time.