Skip to content

chore: bump minimum Go to 1.26 and adopt 1.26 features#2920

Draft
vmaerten wants to merge 1 commit into
mainfrom
feat/adopt-go-1.26
Draft

chore: bump minimum Go to 1.26 and adopt 1.26 features#2920
vmaerten wants to merge 1 commit into
mainfrom
feat/adopt-go-1.26

Conversation

@vmaerten

Copy link
Copy Markdown
Member

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 floor → 1.26: go.mod directive 1.25.101.26.4; drop 1.25.10 from the test.yml / lint.yml CI matrices.
  • Adopt errors.AsType[T] (Go 1.26): add an AsType wrapper in the internal errors package (kept there per the depguard rule) and migrate the errors.As(err, &x) call sites to the generic, type-safe form.
  • Finish sortslices: slices.SortFunc/slices.Sort and slices.Collect(maps.Keys(...)), dropping the sort import from the touched files.
  • go fix ./...: drop obsolete // +build lines from two straggler files.
  • Fix a preexisting vet error: %q used on an int in experiments/errors.go, which Go 1.26's stricter go vet now 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 a CHANGELOG.md entry, and optionally extend the CI matrix to [1.26.x, 1.27.x].

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant