This is a simple layout for Golang projects based on the community standard, with added machinery for running in Docker.
- Select "use this template" to create a new Github repo based on this one.
- Replace
golang-template
with the name of the project. - Optional customization:
- Set the package name in
go.mod
if deploying under a different Github user/organization. - Set the image name in
docker-compose.yml
if deploying to a different Docker registry or repository. - If using dev containers, copy
.devcontainer.example
to.devcontainer
.
- Set the package name in
- Ensure the software license is correct.
- Commit changes and begin developing.
Example run command:
docker-compose run --build --rm app
Available services:
app
- contains the compiled binaries, ready for production deploymentdev
- dev container for running arbitrary build and debug commandstest
- run tests in dev containercover
- run tests with code coverage