Toolbox and building blocks for new Go projects, to get started quickly and right-footed!
Makefilewithlint,test,build,fmtand more- Linting with 
gofmt,gofumpt,go vet,staticcheckandgolangci-lint - Logging setup using the slog logger (with debug and json logging options)
 - GitHub Workflows for linting and testing, as well as releasing and publishing Docker images
 - Entry files for CLI and HTTP server
 - Webserver with
- Graceful shutdown, implementing 
livez,readyzand draining API handlers - Prometheus metrics
 - Using https://pkg.go.dev/github.com/go-chi/chi/v5 for routing
 - Urfave for cli args
 
 - Graceful shutdown, implementing 
 - https://github.com/uber-go/nilaway
 - Postgres database with migrations
 - See also:
- Public project setup: https://github.com/flashbots/flashbots-repository-template
 - Repository for common Go utilities: https://github.com/flashbots/go-utils
 
 
Pick and choose whatever is useful to you! Don't feel the need to use everything, or even to follow this structure.
For advanced Golang knowledge, tips & tricks, see also https://goperf.dev
Build CLI
make build-cliBuild HTTP server
make build-httpserverInstall dev dependencies
go install mvdan.cc/[email protected]
go install honnef.co/go/tools/cmd/[email protected]
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install go.uber.org/nilaway/cmd/[email protected]
go install github.com/daixiang0/[email protected]Lint, test, format
make lint
make test
make fmtDatabase tests (using a live Postgres instance)
Database tests will be run if the RUN_DB_TESTS environment variable is set to 1.
# start the database
docker run -d --name postgres-test -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres
# run the tests
RUN_DB_TESTS=1 make test
# stop the database
docker rm -f postgres-test