monorepo in golang
The crucial feature of go 1.18
that enables monorepo is the use of go workspaces, or go.work
The services/greet
module can reference the libs/util
modules
pip install https://github.com/joh/when-changed/archive/master.zip
apt-get install make | choco install make (windows)
make test-install-gotest
make lint-install
make dev-greet
to start services/greet daemon
Full list of commands are listed in Makefile
If you are on windows, you need to have git bash
cli installed to run the commands
Open another terminal
make watch-greet
- When running
go mod tidy
, packages specified in thego.work
will not be ignored. So, dogo mod tidy -e
instead. The-e
flag causes go mod tidy to attempt to proceed despite errors encountered while loading packages.