New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unused: interface conversion: types.Object is nil, not *types.Func #3938
Labels
bug
Something isn't working
dependencies
Relates to an upstream dependency
feedback required
Requires additional feedback
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
ldez
changed the title
goanalysis_metalinter: interface conversion: types.Object is nil, not *types.Func
unused: interface conversion: types.Object is nil, not *types.Func
Jul 3, 2023
Hello, unused is a part of staticcheck. $ staticcheck ./...
panic: interface conversion: types.Object is nil, not *types.Func
goroutine 4663 [running]:
golang.org/x/exp/typeparams.OriginMethod(0xc005de10e0)
/home/ldez/sources/go/pkg/mod/golang.org/x/exp/typeparams@v0.0.0-20221208152030-732eee02a75a/common.go:112 +0x129
honnef.co/go/tools/unused.(*graph).decl(0xc003f3dcd0, {0xa0da18?, 0xc005dc8b40}, {0x0?, 0x0?})
/home/ldez/sources/go/pkg/mod/honnef.co/go/tools@v0.4.3/unused/unused.go:1155 +0x191
honnef.co/go/tools/unused.(*graph).entry(0xc003f3dcd0)
/home/ldez/sources/go/pkg/mod/honnef.co/go/tools@v0.4.3/unused/unused.go:523 +0xc28
honnef.co/go/tools/unused.run(0xc0021b4f00)
/home/ldez/sources/go/pkg/mod/honnef.co/go/tools@v0.4.3/unused/unused.go:219 +0x245
honnef.co/go/tools/lintcmd/runner.(*analyzerRunner).do(0xc008a73da0, {0xa0edf8?, 0xc008a70460})
/home/ldez/sources/go/pkg/mod/honnef.co/go/tools@v0.4.3/lintcmd/runner/runner.go:992 +0x76a
honnef.co/go/tools/lintcmd/runner.genericHandle({0xa0edf8?, 0xc008a70460}, {0xa0edf8?, 0xc0020eb180?}, 0x0?, 0xc0003ad370, 0xc0088abdb0)
/home/ldez/sources/go/pkg/mod/honnef.co/go/tools@v0.4.3/lintcmd/runner/runner.go:817 +0x130
created by honnef.co/go/tools/lintcmd/runner.(*subrunner).runAnalyzers
/home/ldez/sources/go/pkg/mod/honnef.co/go/tools@v0.4.3/lintcmd/runner/runner.go:1061 +0x70a
$ staticcheck --version
staticcheck 2023.1.3 (v0.4.3) Same result with the branch $ staticcheck --version
staticcheck (no version)
$ staticcheck ./...
panic: interface conversion: types.Object is nil, not *types.Func
goroutine 5071 [running]:
golang.org/x/exp/typeparams.OriginMethod(0xc0070dcf60)
/home/ldez/sources/go/pkg/mod/golang.org/x/exp/typeparams@v0.0.0-20221208152030-732eee02a75a/common.go:112 +0x129
honnef.co/go/tools/unused.(*graph).decl(0xc01459bcd0, {0xa05c38?, 0xc0018a8300}, {0x0?, 0x0?})
/home/ldez/sources/golangci-lint/go-tools/unused/unused.go:1155 +0x191
honnef.co/go/tools/unused.(*graph).entry(0xc01459bcd0)
/home/ldez/sources/golangci-lint/go-tools/unused/unused.go:523 +0xc28
honnef.co/go/tools/unused.run(0xc012b4d5f0)
/home/ldez/sources/golangci-lint/go-tools/unused/unused.go:219 +0x245
honnef.co/go/tools/lintcmd/runner.(*analyzerRunner).do(0xc0099cc4b0, {0xa07078?, 0xc0099bf860})
/home/ldez/sources/golangci-lint/go-tools/lintcmd/runner/runner.go:992 +0x76a
honnef.co/go/tools/lintcmd/runner.genericHandle({0xa07078?, 0xc0099bf860}, {0xa07078?, 0xc004891cc0?}, 0x0?, 0xc000432670, 0xc016273d20)
/home/ldez/sources/golangci-lint/go-tools/lintcmd/runner/runner.go:817 +0x130
created by honnef.co/go/tools/lintcmd/runner.(*subrunner).runAnalyzers
/home/ldez/sources/golangci-lint/go-tools/lintcmd/runner/runner.go:1061 +0x70a ping @dominikh |
Fixed by dominikh/go-tools@65cc494. |
@dominikh The commit is not inside the release branch, is it expected? dominikh/go-tools@v0.4.3...v0.4.4 $ staticcheck -version
staticcheck 2023.1.4 (v0.4.4)
$ staticcheck ./...
panic: interface conversion: types.Object is nil, not *types.Func
goroutine 4762 [running]:
golang.org/x/exp/typeparams.OriginMethod(0xc0031b4900)
golang.org/x/exp/typeparams@v0.0.0-20221208152030-732eee02a75a/common.go:112 +0x111
honnef.co/go/tools/unused.(*graph).decl(0xc00859fcd0, {0xa028a8?, 0xc002e63ce0}, {0x0?, 0x0?})
honnef.co/go/tools/unused/unused.go:1155 +0x185
honnef.co/go/tools/unused.(*graph).entry(0xc00859fcd0)
honnef.co/go/tools/unused/unused.go:523 +0xc14
honnef.co/go/tools/unused.run(0xc008c7c0d0)
honnef.co/go/tools/unused/unused.go:219 +0x225
honnef.co/go/tools/lintcmd/runner.(*analyzerRunner).do(0xc009161530, {0xa03d88?, 0xc0091179a0})
honnef.co/go/tools/lintcmd/runner/runner.go:992 +0x6fd
honnef.co/go/tools/lintcmd/runner.genericHandle({0xa03d88?, 0xc0091179a0}, {0xa03d88?, 0xc009116f00?}, 0x0?, 0xc0003cacf0, 0xc0091ea1d0)
honnef.co/go/tools/lintcmd/runner/runner.go:817 +0x129
created by honnef.co/go/tools/lintcmd/runner.(*subrunner).runAnalyzers in goroutine 4761
honnef.co/go/tools/lintcmd/runner/runner.go:1061 +0x6b5 |
Fixed in 2023.1.5 🤦♂️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
dependencies
Relates to an upstream dependency
feedback required
Requires additional feedback
Welcome
Description of the problem
golangci-lint run
starts having the panic error shown below after this commit: SOF3/kelemetry@ca058d3 (the issue is reproduced with and without explicitly settingrun.go
to 1.20)Version of golangci-lint
Configuration file
Go environment
go env
not relevant, reproduced on actions/setup-go default setup.Verbose output of running
Code example or link to a public repository
SOF3/kelemetry@ca058d3
The text was updated successfully, but these errors were encountered: