Skip to content

govet panic with 1.7 and 1.7.1 #122

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

Closed
srenatus opened this issue Jun 19, 2018 · 2 comments
Closed

govet panic with 1.7 and 1.7.1 #122

srenatus opened this issue Jun 19, 2018 · 2 comments

Comments

@srenatus
Copy link
Contributor

srenatus commented Jun 19, 2018

Trying to upgrade from 1.5 to 1.7.1, I've run into this:

$ golangci-lint run -c ../../.golangci.toml ./...
WARN [runner] Panic stack trace: goroutine 1486 [running]:
runtime/debug.Stack(0x180a3e1, 0x11, 0xc4322a52a0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/golangci/golangci-lint/pkg/lint.Runner.runLinterSafe.func1(0xc4322a5ba8, 0xc432a21b80, 0xb, 0xb, 0x18c5ba0, 0xc42e5eac40)
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:73 +0xbc
panic(0x171d220, 0x1cd5500)
        /usr/local/go/src/runtime/panic.go:502 +0x229
github.com/golangci/golangci-lint/vendor/github.com/golangci/govet.doPackage(0x0, 0xc420d22000, 0xc42016cb00, 0x0, 0x0, 0x0, 0xc43dcdf860, 0x0, 0x0)
        /Users/denis/go/src/github.com/golangci/golangci-lint/vendor/github.com/golangci/govet/main.go:452 +0xc08
github.com/golangci/golangci-lint/vendor/github.com/golangci/govet.Analyze(0x0, 0x0, 0x0, 0xc42016cb00, 0xc420d22000, 0x0, 0x1, 0x1, 0x1, 0x0, ...)
        /Users/denis/go/src/github.com/golangci/golangci-lint/vendor/github.com/golangci/govet/golangci.go:41 +0x26b
github.com/golangci/golangci-lint/pkg/golinters.Govet.runOnSourcePackages(0x18c3340, 0xc420164c00, 0xc432d7b140, 0xc42ce0fc20, 0xc, 0xc42ce0fc20, 0xc, 0xc)
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/golinters/govet.go:219 +0x166
github.com/golangci/golangci-lint/pkg/golinters.Govet.Run(0x18c3340, 0xc420164c00, 0xc432d7b140, 0x10106e8, 0xc4207c6980, 0xc42002f0e0, 0x17f474a, 0xc42e5ead60)
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/golinters/govet.go:40 +0x436
github.com/golangci/golangci-lint/pkg/lint.Runner.runLinterSafe(0xc432a21b80, 0xb, 0xb, 0x18c5ba0, 0xc42e5eac40, 0x18c3340, 0xc420164c00, 0xc432d7af60, 0x18c2500, 0x1d074a8, ...)
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:79 +0x194
github.com/golangci/golangci-lint/pkg/lint.Runner.runWorker.func1()
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:111 +0xe9
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc437c90370, 0x17f2ffa, 0x5, 0xc4207c6e50)
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:75 +0x53
github.com/golangci/golangci-lint/pkg/lint.Runner.runWorker(0xc432a21b80, 0xb, 0xb, 0x18c5ba0, 0xc42e5eac40, 0x18c3340, 0xc420164c00, 0xc432d7af60, 0xc432d7afc0, 0xc432d7b020, ...)
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:110 +0x1e4
github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers.func1(0xc42ce0fbf0, 0xc428af4b10, 0x18c3340, 0xc420164c00, 0xc432d7af60, 0xc432d7afc0, 0xc432d7b020, 0xc422b02300, 0x8, 0x8, ...)
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:165 +0x152
created by github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers
        /Users/denis/go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:162 +0x1b8
WARN [runner] Can't run linter govet: panic occured: runtime error: index out of range
Congrats! No issues were found.

ℹ️ Trying other versions:

  • 1.6.1: ✅
  • 1.7: 💥

⏩ The problem seems to be around a package that has only test files -- and I presume it panics here, pkg.path = astFiles[0].Name.Name.

@srenatus srenatus changed the title govet panic with 1.7.1 govet panic with 1.7 and 1.7.1 Jun 19, 2018
@jirfag
Copy link
Contributor

jirfag commented Jun 19, 2018

thank you!
fast fix is in #123,
then I will add tests and improve it

@jirfag jirfag closed this as completed in 3d426c7 Jun 19, 2018
@srenatus
Copy link
Contributor Author

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

No branches or pull requests

2 participants