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-templatewith the name of the project. - Optional customization:
- Set the package name in
go.modif deploying under a different Github user/organization. - Set the image name in
docker-compose.ymlif deploying to a different Docker registry or repository. - If using dev containers, copy
.devcontainer.exampleto.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 appAvailable 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