Code-Memo

CI for Go

Baseline pipeline

go test ./...
go test -race ./...          # linux/amd64
go vet ./...

Formatting

Keep gofmt non-negotiable:

gofmt -w .

In CI, prefer a check-only step (fail if diff).

Linting

golangci-lint is the common aggregator:

golangci-lint run ./...

Dependency hygiene

go mod tidy
git diff --exit-code go.mod go.sum

Build matrix

Build at least:

Caching

Cache:

This speeds up CI dramatically in mono-repos.