all: drop support for Go 1.18 through 1.24#469
Merged
hajimehoshi merged 1 commit intoJun 23, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR raises the minimum supported Go version to 1.25 to reduce CI matrix runtime and remove now-unnecessary compatibility shims, while modernizing code to use newer stdlib/runtime features.
Changes:
- Bump
go.modlanguage version to Go 1.25 and trim CI to Go 1.25.x/1.26.x. - Remove
internal/xreflectshim usage and switch call sites toreflect.TypeAssert/reflect.TypeFor. - Modernize loops and test helpers (integer
rangeloops;iter.Seq-based struct-field iteration;slices.Clonein objc runtime).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
go.mod |
Raises module language version baseline to Go 1.25. |
.github/workflows/test.yml |
Trims CI Go versions and simplifies race-step guards. |
internal/xreflect/reflect_go124.go |
Removes pre-Go1.25 TypeAssert polyfill. |
internal/xreflect/reflect_go125.go |
Removes Go1.25 TypeAssert wrapper. |
func.go |
Switches to reflect.TypeFor / reflect.TypeAssert now that Go 1.25 is required. |
syscall_unix.go |
Replaces reflect.TypeOf(CDecl{}) with reflect.TypeFor[CDecl](). |
struct_arm64.go |
Modernizes a few reflection/type usages and converts one loop to integer-range form. |
struct_test.go |
Uses iter.Seq for struct-field iteration and relies on new range-var semantics. |
syscall_bench_test.go |
Uses integer range loops in benchmark helper. |
func_test.go |
Uses integer range loops in concurrency test. |
callback_test.go |
Uses integer range loops in callback test. |
objc/objc_runtime_darwin.go |
Removes xreflect, uses reflect.TypeAssert / reflect.TypeFor, and replaces custom clone with slices.Clone. |
objc/objc_block_darwin.go |
Removes xreflect and uses reflect.TypeAssert / reflect.TypeFor. |
objc/objc_runtime_darwin_test.go |
Updates examples to use reflect.TypeFor. |
examples/objc/main_darwin.go |
Updates example to use reflect.TypeFor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
25bff1e to
79d38bf
Compare
79d38bf to
3e5ac01
Compare
Set the go.mod language version to 1.25.0 and trim the CI matrix to the two most recent Go releases. Exercising every release back to 1.18 made test runs long, and that cost grows as more targets are added (e.g. a future windows/arm64). Narrowing the supported range also lowers the maintenance burden of carrying version-gated workarounds. Remove the compatibility shims that only existed for older toolchains: - internal/xreflect, which polyfilled reflect.TypeAssert; callers now use the standard library function directly. - the objc clone helper, replaced by slices.Clone. Modernize the remaining code to the new baseline: integer range loops and reflect.TypeFor, and an iter.Seq-based field iterator in the tests. Updates ebitengine#468 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3e5ac01 to
57c0f81
Compare
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.
What issue is this addressing?
Updates #468
What type of issue is this addressing?
feature
What this PR does | solves
Drops support for Go 1.18 through 1.24, raising the minimum to Go 1.25.
The CI matrix exercised every Go release back to 1.18, which makes test
runs long. That cost only grows as more targets are added (e.g. a future
windows/arm64). Narrowing the supported range also lets us dropversion-gated workarounds, reducing maintenance burden.
Changes:
1.18→1.25.0..github/workflows/test.yml): trim the matrix to the two mostrecent Go releases (
1.25.x,1.26.x), and drop the now-always-true!startsWith(matrix.go, '1.18'/'1.19')guards on the race steps.internal/xreflect(polyfilledreflect.TypeAssert) — callers nowuse the stdlib
reflect.TypeAssertdirectly.objcclonehelper — replaced byslices.Clone.rangeloops,
reflect.TypeFor, and aniter.Seq-based field iterator inthe struct tests.
Verified locally:
go vet,gofmt -s,go build(native +cross-compile to linux/windows/freebsd), and the full test suite
(
CGO_ENABLED=1) all pass.Authored by Claude (Claude Code), on behalf of @hajimehoshi.