Require Go 1.20, test on 1.25/1.26/1.27 - #216
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #216 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 21 -2
Lines 410 397 -13
=========================================
- Hits 410 397 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Onboard with the testing matrix change, but is 1.25 in go mod actually required? Can we survive with some lower version? |
e1c53ae to
0d4d84a
Compare
Yeah 1.20 is fine, some of our other OSS projects note that we only support the two latest versions but not seeing that here |
|
Well supporting last 2 versions is fine if there's some feature we want to use - but if more previous versions arew fine then bumping the minimum unnecessarily is a bit mean. |
There was a problem hiding this comment.
or perhaps I'm struggling to understand? but it seems the file should either go or be merged?
There was a problem hiding this comment.
ah yeah, I should've looked a little more carefully - these two _118 and _119 files can be merged together
The CI matrix (1.17/1.18/1.19) had aged out of upstream support, and the
pinned lint tooling no longer builds on any current toolchain:
golang.org/x/tools@v0.12.1/internal/tokeninternal.go:78:9:
invalid array length -delta * delta (constant -256 of type int64)
Move the matrix to 1.25/1.26/1.27, with lint running on 1.27. Raise the
module's minimum Go version only as far as the source actually requires:
Pointer[T] wraps sync/atomic.Pointer[T], which landed in 1.19, so 1.20 is
the floor. Neither dependency constrains this further -- testify v1.12.1
declares go 1.17 and go.yaml.in/yaml/v3 declares go 1.16.
Bump honnef.co/go/tools to v0.8.1 so staticcheck and golint compile
again. staticcheck v0.8.1 declares `go 1.26.0`, so the tools module sits
well ahead of the library; it is build-only and does not affect
consumers. This supersedes #203.
With a 1.20 floor, the pointer build variants are dead code: the
`go1.18 && !go1.19` constraint is unsatisfiable, so delete that file. The
surviving Pointer[T] is the sync/atomic.Pointer[T] implementation that
every supported toolchain already selected. With no build tags left, the
go118/go119 split is meaningless, so merge the two survivors into a single
pointer.go.
Note that CI does not build on 1.20-1.24, so the declared floor is a
compatibility promise rather than a tested configuration.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0d4d84a to
e4bcf90
Compare
Motivation
The CI matrix was
1.17.x / 1.18.x / 1.19.x, all long out of upstream support, and the pinned lint tooling no longer builds on any current toolchain:Both
golintandstaticcheckfail to compile on this, so theLintstep is unfixable without moving the tooling forward. This is also what blocks #203: Dependabot rewrotetools/go.modtogo 1.26.0(staticcheck 0.8.1's own floor), and Go 1.19 predates the three-componentgodirective, so it cannot even parse the file —invalid go version '1.26.0': must match format 1.23.The aged-out CI matrix and the library's own minimum Go version are separate concerns, so this PR moves CI all the way forward but raises
go.modonly as far as the source actually requires.Changes
.github/workflows/go.yml: matrix →1.25.x / 1.26.x / 1.27.x, withlatest: true(and therefore lint) on1.27.x.go.mod: minimum Go version1.18→1.20. This is the lowest floor the code permits:Pointer[T]wrapssync/atomic.Pointer[T], which landed in 1.19, and the pre-1.19 fallback is deleted below. Neither dependency constrains it further — testify v1.12.1 declaresgo 1.17, go.yaml.in/yaml/v3 v3.0.5 declaresgo 1.16.tools/go.mod,tools/go.sum:honnef.co/go/toolsv0.4.7→v0.8.1, pulling a currentx/tools. This matches Bump honnef.co/go/tools from 0.4.7 to 0.8.1 in /tools #203's dependency set exactly, so Bump honnef.co/go/tools from 0.4.7 to 0.8.1 in /tools #203 can be closed once this lands. staticcheck v0.8.1 declaresgo 1.26.0, so the tools module sits well ahead of the library — it is build-only tooling and does not affect consumers.go1.18 && !go1.19constraint is unsatisfiable, sopointer_go118_pre119.gois deleted, and the now-vacuousgo1.18/go1.19tags are dropped frompointer_go118.go,pointer_go119.goandpointer_test.go. No build tags remain in the package. The survivingPointer[T]is thesync/atomic.Pointer[T]implementation every supported toolchain already selected, so this is a pure deletion with no behavior change.Breaking change
Raising the minimum Go version from 1.18 to 1.20 is breaking for consumers on 1.18 or 1.19 and should be called out in the release notes. I have not added a CHANGELOG entry — there is no
Unreleasedsection yet and I did not want to presume the release framing.Caveat: declared floor is not a tested floor
CI builds 1.25–1.27 only, so 1.20 through 1.24 are a compatibility promise rather than a tested configuration. If you would rather have the floor covered, add
1.20.xto the matrix; if you would rather not carry that promise at all, raisinggo.modto1.25to match CI is the other consistent option.Test plan
Run on
go1.26.4with thego 1.20directive in place:go build ./...— cleango vet ./...— cleango test ./...andgo test -race ./...— passmake gofmt golint staticcheck— exit 0, no findings from staticcheck 2026.2.1🤖 Generated with Claude Code