Generic methods (golang/go#77273) landed in Go 1.27.0 and the validation API
refactor in #54 depends on them, so 1.27 becomes the minimum. The CI matrix
drops 1.25/1.26 rather than keeping a compatibility row that could not compile
the API that follows.
encoding/json.Marshal allocates twice per call on 1.27 where it allocated once
on 1.26, so the two budgets that marshal JSON move with it: json 15 to 16, and
not found 36 to 38 for its nested error payload. Every budget that does not
marshal JSON is unchanged, and no govalin code on those paths changed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Part 1 of #54: raise the minimum Go version so the validation API refactor in #100 and #101 can use
generic methods.
Generic methods (golang/go#77273) landed in Go 1.27.0,
which is now GA. The CI matrix drops 1.25 and 1.26 rather than keeping compatibility rows that could
not compile the API that follows.
The allocation gate moved
encoding/json.Marshalallocates twice per call on 1.27 where it allocated once on 1.26, confirmedin isolation:
So the two budgets that marshal JSON move with it —
json15 → 16, andnot found36 → 38 for itsnested error payload. Every budget that does not marshal JSON is unchanged, and no govalin code on
those paths changed. This is the case
perf_test.goalready anticipates: "escape analysis andinlining change between releases."
Note for anyone working on #100 / #101
The standalone
gofumptbinary cannot parse generic methods yet — it fails withmethod must have no type parameters(mvdan/gofumpt#359, fix expectedshortly). This does not affect CI:
golangci-lint-actionresolvesversion: latest, andgolangci-lint ≥ v2.13.1 built with go1.27 embeds a gofumpt that parses them (verified: clean run and
clean
fmt --diffagainst generic-method code). Locally, usegolangci-lint fmt ./...instead ofgofumpt -won files with generic methods until the fix ships.Verification
go build ./...,go test ./...,go test -race ./...pass on go1.27.0GOVALIN_PERF_GATE=1 go test -run TestAllocationBudget .passes with the updated budgetsgolangci-lint run ./...clean🤖 Generated with Claude Code