Features:
- Dockerfile that leverages cache to avoid unnecessary downloads, compilations and tests. It uses a distroless Debian image with non-root user.
- logging: uses logur as a facade (and adapter) and logrus under the hood. Always uses JSON formatter.
- configuration: uses viper. Convention:
mandatory configuration file named
config.toml
. - flags: with pflag
- a
run()
function to facilitate tests.
Run with:
cd cmd/myapp
go run .
Build container image with:
# DOCKER_BUILDKIT=1
docker build -t goboilerplate:latest .
Run container with:
docker compose up
- devcontainer
- VSCode launch and task
- ko
- graceful degradation
- HTTP server
- telemetry
- helloworld tests
Heavily inspired by modern-go-application.