chore: bump minimum Go to 1.26 and adopt 1.26 features#2920
Draft
vmaerten wants to merge 1 commit into
Draft
Conversation
Prepares the ground for when Go 1.27 ships and 1.25 is dropped from the two-latest support window. Not to be merged before 1.27 is released. - go.mod: go directive 1.25.10 -> 1.26.4; drop 1.25.10 from the test and lint CI matrices. - Adopt errors.AsType[T]: add a wrapper in the internal errors package (kept there per the depguard rule) and migrate the errors.As call sites to the generic, type-safe form. - Finish the sort -> slices migration (SortFunc/Sort) and use slices.Collect(maps.Keys(...)), dropping the sort import. - go fix ./...: drop obsolete // +build lines from two stragglers. - Fix a preexisting %q-on-int vet error in experiments/errors.go that Go 1.26's stricter vet now reports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares the ground for adopting Go 1.26 features. Do not merge before Go 1.27 is released — this drops 1.25 from the two-latest support window, so it should only land once 1.27 ships.
Changes
go.moddirective1.25.10→1.26.4; drop1.25.10from thetest.yml/lint.ymlCI matrices.errors.AsType[T](Go 1.26): add anAsTypewrapper in the internalerrorspackage (kept there per thedepguardrule) and migrate theerrors.As(err, &x)call sites to the generic, type-safe form.sort→slices:slices.SortFunc/slices.Sortandslices.Collect(maps.Keys(...)), dropping thesortimport from the touched files.go fix ./...: drop obsolete// +buildlines from two straggler files.%qused on anintinexperiments/errors.go, which Go 1.26's strictergo vetnow reports.Test plan
go build ./...,go vet ./...(incl.-tags signals watch fsbench) — clean on Go 1.26.golangci-lint run ./...— 0 issues (depguard,modernize,gofumpt).go test ./...— all packages pass.Before merging (once 1.27 is out): rebase on
main, add aCHANGELOG.mdentry, and optionally extend the CI matrix to[1.26.x, 1.27.x].