A minimal, batteries-included Go template for new projects. Skip the boilerplate — start from a clean, idiomatic scaffold with linting, CI/CD, releases, and agent tooling already wired up.
- Idiomatic scaffold — a no-op
main.goplus the conventionalcmd/,internal/, andpkg/layout, ready for your first package. A minimalpkg/examplepackage with a table-driven test shows the house testing pattern — replace it with your own. - Linting & formatting —
golangci-lintv2 (formatters +default: alllinters) in CI, with MegaLinter covering everything else. A pre-commit hook runsgolangci-lintformatting (andmockerymock generation) locally on commit. - CI/CD — a required-checks workflow on pull requests and the merge queue, plus a GoReleaser release pipeline (
cd.yaml) triggered onv*tags. - Coverage —
go testcoverage reported via GitHub Code Quality. - Dependency management — Dependabot keeps Go modules and pinned GitHub Actions current (daily).
- Agent-ready —
AGENTS.mdconventions and a.claude/skills/maintaincard so the autonomous Daily AI Assistant (and any agentic tool) can maintain the repo.
The minimum Go version is declared in go.mod — the single source of truth.
Create a new repository from the template with the GitHub CLI:
gh repo create my-project --template devantler-tech/go-template --public --clone
cd my-projectOr click Use this template on the repository page.
Then personalise the scaffold — repoint the module path (in go.mod, the Go
imports, and the README badges) in one shot:
scripts/rename-placeholders.sh github.com/<you>/my-projectRun with no argument to derive the path from your origin GitHub remote. The
script leaves the upstream Use this template links above untouched, runs
go mod tidy, and you can review the result with git diff. (Prefer to do it
by hand? go mod edit -module github.com/<you>/my-project && go mod tidy.)
go get example.com/awesome-lib@latestgo build ./...go run .go test ./...This template is maintained by an autonomous AI assistant. The conventions, validation commands, and contribution workflow live in AGENTS.md.