Opinionated Go starter with Fiber v3, pre-commit hooks, linting, testing, proto tooling, Docker, and CI skeletons. Version pins in this template are intentional. Do not change them during setup.
-
Clone and set your module name
git clone https://github.com/hyp3rd/starter.git my-new-project cd my-new-project ./setup-project.sh --module github.com/your/module -
Install toolchain (core). Proto tools stay optional.
make prepare-toolchain # If you need proto/gRPC/OpenAPI PROTO_ENABLED=true make prepare-proto-tools -
Run quality gates and sample app
make lint make test make run # serves /health on HOSTNAME:PORT (defaults localhost:8000)
-
Optional: Docker and Compose
cp .env.example .env # shared runtime config for compose/requests docker build -t starter-app . docker compose up --build
- Fiber v3 sample service with
/health - Pre-commit hooks (gci, gofumpt, golangci-lint, tests, spell/yaml/markdown lint)
- Make targets for lint/test/vet/security/proto
- Proto tooling via buf (configs promoted from examples)
- Dockerfile (multi-stage) and docker-compose.yml
- GitHub Actions templates for lint, test+coverage, proto, security, and pre-commit
- Dependabot for Go modules and GitHub Actions
- Module path & imports:
setup-project.shreplaces#PROJECTin Makefile and hooks. If you change the module later, rerun the script with--module. - Go version: Target Go 1.25.x (keep pins as provided).
- GCI prefix: Set by the setup script; defaults to
#PROJECT(see.project-settings.env). - Project settings:
.project-settings.envis the single source for tool versions, Go version, proto toggle, and GCI prefix; CI and hooks source it. - Proto toggle: Set
PROTO_ENABLED=falsein.project-settings.envto skip proto lint/format/CI. When enabled, runmake prepare-proto-tools. - Proto: Copy/edit
api/core/v1/health.proto. Generate stubs withmake proto. Generated files land inpkg/api/core/v1/. - HTTP request examples:
requests/*.httpread variables fromrequests/.env(copy from.env-exampleor reuse the root.env).health_get.httphits/health. - Docker: Override
APP_VERSION,HOSTNAME,PORTvia.env(used by docker compose) ordocker run -e. Healthchecks call/healthvia the app binary.
prepare-toolchain— install core tools (gci, gofumpt, golangci-lint, staticcheck, govulncheck, gosec)prepare-proto-tools— install buf + protoc plugins (optional, controlled by PROTO_ENABLED)init— run setup-project.sh with current module and install tooling (respects PROTO_ENABLED)lint— gci, gofumpt, staticcheck, golangci-linttest/test-race/benchvet,sec,proto,run,run-container,update-deps,update-toolchain
Run make help for the full list.
- Go 1.25.x
- Docker
- Git
- Python 3 +
pre-commit - Optional proto toolchain (installed via
make prepare-proto-tools)
.github/workflows/lint.yml— gofumpt, gci, staticcheck, golangci-lint (caches + tidy check).github/workflows/test.yml— unit tests (race + coverage artifact, caches).github/workflows/proto.yml— buf format/lint/generate (skips whenPROTO_ENABLED=false).github/workflows/security.yml— govulncheck + gosec.github/workflows/pre-commit.yml— pre-commit hooks on all files.github/dependabot.yml— Go modules + GitHub Actions updates
- Tests required for changes; run
make lint testbefore PRs. - Suggested branch naming:
feat/<scope>,fix/<scope>,chore/<scope>. - Update docs when altering tooling, Make targets, or setup steps.
.project-settings.env— versions and prefixes for tooling/CI/Docker..env.example— runtime defaults for the app/compose/requests. Copy to.envfor local runs and docker compose. Copy torequests/.envif you prefer a dedicated file.
- CI jobs to pass: lint, test, security, pre-commit (and proto when
PROTO_ENABLED=true). - Run
make lint testlocally before opening a PR; include docs updates when changing tooling or workflows.
- go.mod/go.sum changes after tidy: run
go mod tidy, commit the changes. - Tool missing errors: rerun
make prepare-toolchain(orprepare-proto-toolsfor proto). - Pre-commit slow: run
pre-commit run --all-filesonce to warm caches.
GNU GPL v3. See LICENSE.