Skip to content
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

staticcheck: unhandled type *ir.ArrayConst #4662

Open
5 tasks done
itsdevbear opened this issue Apr 18, 2024 · 5 comments
Open
5 tasks done

staticcheck: unhandled type *ir.ArrayConst #4662

itsdevbear opened this issue Apr 18, 2024 · 5 comments
Assignees
Labels
bug Something isn't working dependencies Relates to an upstream dependency

Comments

@itsdevbear
Copy link

Welcome

Description of the problem

ERRO [runner] Panic: nilness: package "ssz" (isInitialPkg: false, needAnalyzeSource: true): internal error: unhandled type *ir.ArrayConst: goroutine 22646 [running]:
runtime/debug.Stack()
        /opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/debug/stack.go:24 +0x64
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func1()
        /Users/dev/go/pkg/mod/github.com/golangci/golangci-lint@v1.57.2/pkg/goanalysis/runner_action.go:108 +0x21c
panic({0x103149ac0?, 0x1400977fb80?})
        /opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/panic.go:770 +0x124
honnef.co/go/tools/analysis/facts/nilness.impl.func1({0x14b4057e0, 0x14003600120})
        /Users/dev/go/pkg/mod/honnef.co/go/tools@v0.4.7/analysis/facts/nilness/nilness.go:239 +0x920
honnef.co/go/tools/analysis/facts/nilness.impl.func1({0x103388ff8, 0x14007e22100})
        /Users/dev/go/pkg/mod/honnef.co/go/tools@v0.4.7/analysis/facts/nilness/nilness.go:147 +0x958
honnef.co/go/tools/analysis/facts/nilness.impl(0x14001f7c750, 0x140042db900, 0x1400442ec78)
        /Users/dev/go/pkg/mod/honnef.co/go/tools@v0.4.7/analysis/facts/nilness/nilness.go:246 +0x2c8
honnef.co/go/tools/analysis/facts/nilness.run(0x14001f7c750)
        /Users/dev/go/pkg/mod/honnef.co/go/tools@v0.4.7/analysis/facts/nilness/nilness.go:66 +0xf4
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyze(0x14003eaa2c0)
        /Users/dev/go/pkg/mod/github.com/golangci/golangci-lint@v1.57.2/pkg/goanalysis/runner_action.go:190 +0x8c4
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func2()
        /Users/dev/go/pkg/mod/github.com/golangci/golangci-lint@v1.57.2/pkg/goanalysis/runner_action.go:112 +0x20
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0x140006131d0, {0x102daeee3, 0x7}, 0x14002c78f30)
        /Users/dev/go/pkg/mod/github.com/golangci/golangci-lint@v1.57.2/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe(0x10274c760?)
        /Users/dev/go/pkg/mod/github.com/golangci/golangci-lint@v1.57.2/pkg/goanalysis/runner_action.go:111 +0x78
github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze.func2(0x14003eaa2c0)
        /Users/dev/go/pkg/mod/github.com/golangci/golangci-lint@v1.57.2/pkg/goanalysis/runner_loadingpackage.go:80 +0xb0
created by github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze in goroutine 2145
        /Users/dev/go/pkg/mod/github.com/golangci/golangci-lint@v1.57.2/pkg/goanalysis/runner_loadingpackage.go:75 +0x184 

Version of golangci-lint

go run github.com/golangci/golangci-lint/cmd/golangci-lint --version
golangci-lint has version v1.57.2 built with go1.22.2 from (unknown, modified: ?, mod sum: "h1:NNhxfZyL5He1WWDrIvl1a4n5bvWZBcgAqBwlJAAgLTw=") on (unknown)
dev@Devs-MacBook-Pro-2 beacon-kit % 

Configuration

# paste configuration file or CLI flags here

Go environment

$ go version && go env
# paste output here

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

A minimal reproducible example or link to a public repository

// add your code here

Validation

  • Yes, I've included all information above (version, config, etc.).
@itsdevbear itsdevbear added the bug Something isn't working label Apr 18, 2024
Copy link

boring-cyborg bot commented Apr 18, 2024

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez ldez added feedback required Requires additional feedback dependencies Relates to an upstream dependency labels Apr 18, 2024
@ldez
Copy link
Member

ldez commented Apr 18, 2024

Hello,

can you provide a reproducible example?

@ldez ldez removed the feedback required Requires additional feedback label Apr 18, 2024
@ldez
Copy link
Member

ldez commented Apr 18, 2024

It's a problem with Staticcheck dominikh/go-tools#1397

The problem has been fixed by dominikh/go-tools@b3ee554

But this commit is missing from the latest release branch of staticcheck.

@itsdevbear
Copy link
Author

Oh wow thanks for digging in! Is there a way to force the usage of latest main for static check within golangci?

@ldez
Copy link
Member

ldez commented Apr 18, 2024

staticcheck uses release branches, the difference between the main branch and a release branch, is complex to verify.
So I think it is not a good idea to use the main branch.

Linters are classic Go modules, so to use another version of a dependency you have to update the go.mod and compile golangci-lint.

@ldez ldez self-assigned this Apr 20, 2024
@ldez ldez changed the title bug: Unhandled type exception staticcheck: unhandled type *ir.ArrayConst Apr 24, 2024
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
Projects
None yet
Development

No branches or pull requests

3 participants
@ldez @itsdevbear and others