Required:
- Golang ~> 1.23 Preferred:
- Make
- Docker
The following commands download all dependencies and installs any required tools for development.
go mod download
make build-tools
Anytime changes to the gRPC API are made, the following command should be run to generate protobuf files and update the mocks used for testing.
make protos
Any changes to the underlying database schema should be reflected with a migration file in the migrations folder. The following command will generate a new migration file.
migrate create -ext sql -dir migrations
Migrations are auto applied on startup when using a pgx repository.
The application version is automatically taken as the latest version tag.
Binary: make build
the output result will be placed in the bin
folder in the project root directory.\
Docker: \
make docker
builds a docker image calledsro-<app-name>
with 3 tags variantslatest
,${version}
, and${version}-${commit hash}
.make push
push the image to the docker repository.make docker push
runs docker then push.
Note: A helper command make aws-docker-login
is available to authenticate with the default aws credential context if pushing to AWS ECR.
make test
runs all tests and builds a coverage reportmake report
views the coverage report in the browsermake test-watch
runs the tests with coverage on all.go
file changes.make report-watch
updates coverage results as they update.make dev-watch -j
simply runs bothtest-watch
andreport-watch
in parallel.