Go Quality Gates
Every change must pass all four gates before being considered done:
go build ./... # Successful compilationgolangci-lint run ./... # Zero lint warnings (includes staticcheck, errcheck, govet, gofmt…)go test -race ./... # All tests pass, no data racesgovulncheck ./... # No known vulnerabilities in dependenciesAll four are equally important. Any lint warning, race condition, or test failure is treated as a build failure.
golangci-lint
Section titled “golangci-lint”golangci-lint is the standard Go linter aggregator — it runs staticcheck and a curated set of additional linters in one pass.
Minimum recommended linters (.golangci.yml):
linters: enable: - staticcheck # SA*, S1*, QF* checks - errcheck # unhandled errors - govet # go vet checks - gofmt # formatting - gosimple # simplification suggestions - unused # unused code - gosec # security anti-patterns- No
//nolintwithout an explicit justification comment on the same line staticcheck:ignoredirectives are also forbidden without justification
- Follow standard Go conventions (
gofmt, Effective Go) - Prefer
internal/packages — avoid exporting at the module root unless intentional - Error wrapping: use
fmt.Errorf("context: %w", err)consistently