Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Internal] Bump staticcheck to 0.5.1 and add go 1.23 test coverage (#…
…1106) ## What changes are proposed in this pull request? This PR updates the version of staticcheck used to the latest version (0.5.1). This is needed for compatibility with recent versions of go. When running the current version (0.4.0) using go 1.23.4, I get the following error: ``` panic: Cannot range over: func(yield func(K, V) bool) goroutine 323 [running]: honnef.co/go/tools/go/ir.(*builder).rangeStmt(0x140084a1a30, 0x14008dcd900, 0x140088cdb00, 0x0, {0x100aa3ef0, 0x140088cdb00}) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:2181 +0x6dc honnef.co/go/tools/go/ir.(*builder).stmt(0x140084a1a30, 0x14008dcd900, {0x100aa62d8?, 0x140088cdb00?}) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:2394 +0x1c0 honnef.co/go/tools/go/ir.(*builder).stmtList(...) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:847 honnef.co/go/tools/go/ir.(*builder).stmt(0x140084a1a30, 0x14008dcd900, {0x100aa5f18?, 0x14003654e10?}) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:2352 +0x10c4 honnef.co/go/tools/go/ir.(*builder).buildFunction(0x140084a1a30, 0x14008dcd900) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:2464 +0x368 honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0x140084a1a30, 0x140006af5f0, 0x14003654e70) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:2501 +0x1a4 honnef.co/go/tools/go/ir.(*Package).build(0x140006af5f0) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:2605 +0x934 sync.(*Once).doSlow(0x140084de0e0?, 0x140088cd6e0?) /opt/homebrew/Cellar/go/1.23.4/libexec/src/sync/once.go:76 +0xf8 sync.(*Once).Do(...) /opt/homebrew/Cellar/go/1.23.4/libexec/src/sync/once.go:67 honnef.co/go/tools/go/ir.(*Package).Build(...) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/go/ir/builder.go:2523 honnef.co/go/tools/internal/passes/buildir.run(0x14003876e10) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/internal/passes/buildir/buildir.go:86 +0x134 honnef.co/go/tools/lintcmd/runner.(*analyzerRunner).do(0x1400387b920, {0x100aa8998?, 0x140086ef860}) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/lintcmd/runner/runner.go:992 +0x600 honnef.co/go/tools/lintcmd/runner.genericHandle({0x100aa8998, 0x140086ef860}, {0x100aa8998?, 0x140086ef7c0?}, 0x14008dc83f0, 0x140004829b0, 0x140072dfa30) /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/lintcmd/runner/runner.go:817 +0x10c created by honnef.co/go/tools/lintcmd/runner.(*subrunner).runAnalyzers in goroutine 321 /Users/miles/go/pkg/mod/honnef.co/go/tools@v0.4.0/lintcmd/runner/runner.go:1061 +0x568 exit status 2 ``` Additionally, some things that passed linting before are no longer allowed. These have been fixed without affecting the behavior. Note that the one version of staticcheck does not work with every go version, so I changed the dependency for tests from `lint` to `vendor` so that linting is not run on every go version that we test on. Finally, I add unit test coverage for 1.23 and run linting and formatting with this golang version. ## How is this tested? No additional tests, but staticcheck is still enforced as part of CI.
- Loading branch information