Skip to content

feat: upgrade to Go 1.26 and modernize with go fix - #95

Merged
bxcodec merged 7 commits into
mainfrom
fix/upgrade-to-go126
Jul 19, 2026
Merged

bxcodec merged 7 commits into
mainfrom
fix/upgrade-to-go126

Conversation

@bxcodec

@bxcodec bxcodec commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Upgrades the module to Go 1.26 and runs the modernization fixers that ship with it, plus the tooling and CI changes needed to keep the matrix honest.

Go version

go.mod moves from 1.24.0 to 1.26.0, and the now-redundant toolchain line is gone. The directive stays at minor level (1.26.0, not a specific patch) on purpose: patch releases add no language features, so pinning 1.26.5 would force every consumer and CI runner onto that exact build for nothing. Any 1.26.x satisfies the floor.

Modernization (go fix)

Mechanical rewrites applied across the codebase, behavior unchanged:

  • interface{} becomes any
  • reflect.Ptr becomes reflect.Pointer
  • Counter loops that only use the index become for i := range n
  • Hand-rolled "does this slice contain X" loops become slices.Contains

Tooling and lint

  • Bumped golangci-lint 2.1.6 to 2.12.2 in tools.Makefile. The old build can't load a Go 1.26 module, so lint failed before it ran a single check.
  • Added a goconst exclusion for lorem.go in .golangci.yaml. The strings it flags ("et", "qui", "aut"...) are Latin words in the lorem-ipsum word list, not magic constants worth extracting.

CI

Two changes to .github/workflows/go.yml, both about making the version matrix mean what it says:

  • GOTOOLCHAIN: local at the workflow level. Without it, Go's default auto mode silently downloads whatever version go.mod requires and ignores the version setup-go installed, so every matrix leg secretly runs the same toolchain. local makes each leg run exactly what it installed, and fail loudly if that's below the floor instead of hiding the mismatch.
  • Matrix aligned to ~1.26. Every entry has to be at or above the go.mod floor now, otherwise it stops at the toolchain gate before compiling.

Verification

  • go build ./...: clean
  • go vet ./...: clean
  • go test ./...: 274 tests pass across 5 packages

@bxcodec
bxcodec marked this pull request as draft July 13, 2026 06:22
@bxcodec
bxcodec marked this pull request as ready for review July 13, 2026 06:46
@bxcodec
bxcodec requested a review from geshtng July 13, 2026 06:46
@bxcodec bxcodec changed the title fix: upgrade to go 1.26 feat: upgrade to go 1.26 Jul 13, 2026
@bxcodec bxcodec changed the title feat: upgrade to go 1.26 chore: upgrade to Go 1.26 and modernize with go fix Jul 13, 2026
@geshtng

geshtng commented Jul 13, 2026

Copy link
Copy Markdown
Member

Should we change interface{} to any from README.md also ?

Comment thread pkg/slice/helpers.go Resolved
@bxcodec
bxcodec requested a review from geshtng July 18, 2026 12:26
@bxcodec bxcodec changed the title chore: upgrade to Go 1.26 and modernize with go fix feat: upgrade to Go 1.26 and modernize with go fix Jul 19, 2026
@bxcodec
bxcodec merged commit 9f848d5 into main Jul 19, 2026
2 checks passed
@bxcodec
bxcodec deleted the fix/upgrade-to-go126 branch July 19, 2026 11:50
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.

2 participants