Skip to content

Update honnef.co/go/tools/cmd/staticcheck version in Makefile#670

Merged
vearutop merged 1 commit intocucumber:mainfrom
RezaZareiii:main
Dec 19, 2024
Merged

Update honnef.co/go/tools/cmd/staticcheck version in Makefile#670
vearutop merged 1 commit intocucumber:mainfrom
RezaZareiii:main

Conversation

@RezaZareiii
Copy link
Copy Markdown
Contributor

@RezaZareiii RezaZareiii commented Dec 16, 2024

🤔 What's changed?

Updated the dependency for honnef.co/go/tools in the Makefile from version v0.4.7 to v0.5.1. This update resolves a panic issue that occurs when running make test with Go 1.23 or later, which introduced changes in range over function types.

Fixes #672

⚡️ What's your motivation?

The previous version of the honnef.co/go/tools library (v0.4.7) is incompatible with Go 1.23+ due to changes in how range is handled for function types with signatures like func(T comparable) bool. This resulted in the following runtime error when running make test :

running all tests
panic: Cannot range over: func(yield func(E) bool)

goroutine 209 [running]:
honnef.co/go/tools/go/ir.(*builder).rangeStmt(0xc000e93a60, 0xc000e24c80, 0xc0002280c0, 0x0, {0x1ec09d0, 0xc0002280c0})
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2225 +0x894
honnef.co/go/tools/go/ir.(*builder).stmt(0xc000e93a60, 0xc000e24c80, {0x1ec2d78?, 0xc0002280c0?})
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2438 +0x20a
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:859
honnef.co/go/tools/go/ir.(*builder).stmt(0xc000e93a60, 0xc000e24c80, {0x1ec29b8?, 0xc0001b0e70?})
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2396 +0x1415
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc000e93a60, 0xc000e24c80)
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2508 +0x417
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0xc000e93a60, 0xc000510a20, 0xc0001b0ea0)
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2545 +0x189
honnef.co/go/tools/go/ir.(*Package).build(0xc000510a20)
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2649 +0xb46
sync.(*Once).doSlow(0xc000bf00e0?, 0xc0002a5bc0?)
        /usr/local/Cellar/go/1.23.4/libexec/src/sync/once.go:76 +0xb4
sync.(*Once).Do(...)
        /usr/local/Cellar/go/1.23.4/libexec/src/sync/once.go:67
honnef.co/go/tools/go/ir.(*Package).Build(...)
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2567
honnef.co/go/tools/internal/passes/buildir.run(0xc0002c6ea0)
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/internal/passes/buildir/buildir.go:86 +0x18b
honnef.co/go/tools/lintcmd/runner.(*analyzerRunner).do(0xc000d8a8a0, {0x1ec54d8?, 0xc000a98fa0})
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:992 +0x71b
honnef.co/go/tools/lintcmd/runner.genericHandle({0x1ec54d8, 0xc000a98fa0}, {0x1ec54d8?, 0xc000a98f00?}, 0xc000d80e70, 0xc00042b6b0, 0xc000bfa250)
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:817 +0x11f
created by honnef.co/go/tools/lintcmd/runner.(*subrunner).runAnalyzers in goroutine 121
        /Users/ray/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:1061 +0x6a6
exit status 2
make: *** [test] Error 1

Upgrading to v0.5.1 resolves this issue and ensures compatibility with the latest Go versions.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.82%. Comparing base (153db4e) to head (dc03e88).
Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #670      +/-   ##
==========================================
- Coverage   83.21%   79.82%   -3.39%     
==========================================
  Files          28       41      +13     
  Lines        3413     4050     +637     
==========================================
+ Hits         2840     3233     +393     
- Misses        458      697     +239     
- Partials      115      120       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vearutop vearutop merged commit 14fe127 into cucumber:main Dec 19, 2024
@vearutop
Copy link
Copy Markdown
Member

Thank you!

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.

make test failure on go1.23.2 due to statickcheck@0.4.7

2 participants