{"id":20433881,"url":"https://github.com/flashbots/go-template","last_synced_at":"2025-08-26T15:18:43.338Z","repository":{"id":66114718,"uuid":"460089910","full_name":"flashbots/go-template","owner":"flashbots","description":"Template for Go projects","archived":false,"fork":false,"pushed_at":"2024-11-19T07:43:26.000Z","size":104,"stargazers_count":40,"open_issues_count":5,"forks_count":6,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-26T15:21:10.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashbots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-16T16:40:03.000Z","updated_at":"2025-03-24T15:16:12.000Z","dependencies_parsed_at":"2023-11-23T16:24:02.599Z","dependency_job_id":"b9ec736e-b63d-4e1d-9725-3af5cf23077f","html_url":"https://github.com/flashbots/go-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/go-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631676,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:22:09.701Z","updated_at":"2025-08-26T15:18:43.319Z","avatar_url":"https://github.com/flashbots.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-template\n\n[![Goreport status](https://goreportcard.com/badge/github.com/flashbots/go-template)](https://goreportcard.com/report/github.com/flashbots/go-template)\n[![Test status](https://github.com/flashbots/go-template/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/flashbots/go-template/actions?query=workflow%3A%22Checks%22)\n\nToolbox and building blocks for new Go projects, to get started quickly and right-footed!\n\n* [`Makefile`](https://github.com/flashbots/go-template/blob/main/Makefile) with `lint`, `test`, `build`, `fmt` and more\n* Linting with `gofmt`, `gofumpt`, `go vet`, `staticcheck` and `golangci-lint`\n* Logging setup using the [slog logger](https://pkg.go.dev/golang.org/x/exp/slog) (with debug and json logging options)\n* [GitHub Workflows](.github/workflows/) for linting and testing, as well as releasing and publishing Docker images\n* Entry files for [CLI](/cmd/cli/main.go) and [HTTP server](/cmd/httpserver/main.go)\n* Webserver with\n  * Graceful shutdown, implementing `livez`, `readyz` and draining API handlers\n  * Prometheus metrics\n  * Using https://pkg.go.dev/github.com/go-chi/chi/v5 for routing\n  * [Urfave](https://cli.urfave.org/) for cli args\n* https://github.com/uber-go/nilaway\n* Postgres database with migrations\n* See also:\n  * Public project setup: https://github.com/flashbots/flashbots-repository-template\n  * Repository for common Go utilities: https://github.com/flashbots/go-utils\n\nPick and choose whatever is useful to you! Don't feel the need to use everything, or even to follow this structure.\n\nFor advanced Golang knowledge, tips \u0026 tricks, see also https://goperf.dev\n\n---\n\n## Getting started\n\n**Build CLI**\n\n```bash\nmake build-cli\n```\n\n**Build HTTP server**\n\n```bash\nmake build-httpserver\n```\n\n**Install dev dependencies**\n\n```bash\ngo install mvdan.cc/gofumpt@v0.4.0\ngo install honnef.co/go/tools/cmd/staticcheck@2024.1.1\ngo install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3\ngo install go.uber.org/nilaway/cmd/nilaway@v0.0.0-20240821220108-c91e71c080b7\ngo install github.com/daixiang0/gci@v0.11.2\n```\n\n**Lint, test, format**\n\n```bash\nmake lint\nmake test\nmake fmt\n```\n\n\n**Database tests (using a live Postgres instance)**\n\nDatabase tests will be run if the `RUN_DB_TESTS` environment variable is set to `1`.\n\n```bash\n# start the database\ndocker run -d --name postgres-test -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres\n\n# run the tests\nRUN_DB_TESTS=1 make test\n\n# stop the database\ndocker rm -f postgres-test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fgo-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Fgo-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fgo-template/lists"}