Skip to content

all: drop support for Go 1.18 through 1.24#469

Merged
hajimehoshi merged 1 commit into
ebitengine:mainfrom
hajimehoshi:claude/distracted-morse-7dd4a9
Jun 23, 2026
Merged

all: drop support for Go 1.18 through 1.24#469
hajimehoshi merged 1 commit into
ebitengine:mainfrom
hajimehoshi:claude/distracted-morse-7dd4a9

Conversation

@hajimehoshi

Copy link
Copy Markdown
Member

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 drop
version-gated workarounds, reducing maintenance burden.

Changes:

  • go.mod: language version 1.181.25.0.
  • CI (.github/workflows/test.yml): trim the matrix to the two most
    recent 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.
  • Remove compatibility shims that only existed for older toolchains:
    • internal/xreflect (polyfilled reflect.TypeAssert) — callers now
      use the stdlib reflect.TypeAssert directly.
    • the objc clone helper — replaced by slices.Clone.
  • Modernize the remaining code to the new baseline: integer range
    loops, reflect.TypeFor, and an iter.Seq-based field iterator in
    the 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.

Copilot AI review requested due to automatic review settings June 20, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mod language version to Go 1.25 and trim CI to Go 1.25.x/1.26.x.
  • Remove internal/xreflect shim usage and switch call sites to reflect.TypeAssert / reflect.TypeFor.
  • Modernize loops and test helpers (integer range loops; iter.Seq-based struct-field iteration; slices.Clone in 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.

Comment thread struct_arm64.go
@hajimehoshi hajimehoshi force-pushed the claude/distracted-morse-7dd4a9 branch 2 times, most recently from 25bff1e to 79d38bf Compare June 20, 2026 14:56
Comment thread struct_test.go Outdated
@hajimehoshi hajimehoshi force-pushed the claude/distracted-morse-7dd4a9 branch from 79d38bf to 3e5ac01 Compare June 22, 2026 17:35

@TotallyGamerJet TotallyGamerJet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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>
@hajimehoshi hajimehoshi force-pushed the claude/distracted-morse-7dd4a9 branch from 3e5ac01 to 57c0f81 Compare June 23, 2026 03:00
@hajimehoshi hajimehoshi merged commit 3c86956 into ebitengine:main Jun 23, 2026
16 checks passed
@hajimehoshi hajimehoshi deleted the claude/distracted-morse-7dd4a9 branch June 23, 2026 03:13
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.

3 participants