Skip to content

"No issues were found" even with an blank file #33

Closed
@quantonganh

Description

@quantonganh

Steps to reproduce:

  • cd /tmp
  • touch blank.go
  • then run golangci-lint run -v blank.go:
INFO[0000] Active linters: [deadcode govet errcheck megacheck gas varcheck ineffassign structcheck]
INFO[0000] Found paths for analysis for 56.244µs: [blank.go]
/tmp/blank.go:1:1: expected 'package', found 'EOF'
INFO[0000] Program loading took 3.005445ms
INFO[0000] SSA repr building took 7.026µs
INFO[0000] worker.3 took 1.807229ms with stages: errcheck: 924.983µs, ineffassign: 846.136µs, varcheck: 14.522µs, structcheck: 5.831µs, deadcode: 3.545µs
INFO[0000] worker.4 took 1.854175ms with stages: govet: 1.845642ms
INFO[0000] Panic stack trace: goroutine 38 [running]:
runtime/debug.Stack(0x17d70b6, 0x11, 0xc42042f7c8)
        /usr/local/Cellar/go/1.10.1/libexec/src/runtime/debug/stack.go:24 +0xa7
github.com/golangci/golangci-lint/pkg.runLinterSafe.func1(0xc42042fd10)
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/runner.go:34 +0xc2
panic(0x16ee1a0, 0x1c8efa0)
        /usr/local/Cellar/go/1.10.1/libexec/src/runtime/panic.go:502 +0x229
go/token.(*File).Name(...)
        /usr/local/Cellar/go/1.10.1/libexec/src/go/token/position.go:105
github.com/golangci/golangci-lint/vendor/github.com/GoASTScanner/gas.(*Analyzer).ProcessProgram(0xc420104230, 0xc4200c4080)
        /Users/quanta/go/src/github.com/golangci/golangci-lint/vendor/github.com/GoASTScanner/gas/analyzer.go:148 +0x16d
github.com/golangci/golangci-lint/pkg/golinters.Gas.Run(0x188a280, 0xc42013e840, 0xc4200fee10, 0x102a909, 0x8, 0xc420106200, 0x2, 0xc42013cc80)
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/golinters/gas.go:34 +0x1c3
github.com/golangci/golangci-lint/pkg.runLinterSafe(0x188a280, 0xc42013e840, 0xc4200fee10, 0x18892c0, 0x1cc0a20, 0x0, 0x0, 0x0, 0x1881020, 0xc42041e3a0)
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/runner.go:38 +0x9f
github.com/golangci/golangci-lint/pkg.runWorker.func1()
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/runner.go:61 +0x64
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc420106040, 0x17beda2, 0x3, 0xc42013ce60)
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:73 +0x53
github.com/golangci/golangci-lint/pkg.runWorker(0x188a280, 0xc42013e840, 0xc4200fee10, 0xc4201a4d80, 0xc4201a4de0, 0xc4204c2008, 0x8)
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/runner.go:60 +0x185
github.com/golangci/golangci-lint/pkg.(*SimpleRunner).runWorkers.func1(0xc420369450, 0x188a280, 0xc42013e840, 0xc4200fee10, 0xc4201a4d80, 0xc4201a4de0, 0xc4201a4e40, 0x4, 0x4, 0x0)
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/runner.go:118 +0x117
created by github.com/golangci/golangci-lint/pkg.(*SimpleRunner).runWorkers
        /Users/quanta/go/src/github.com/golangci/golangci-lint/pkg/runner.go:115 +0x1e6

INFO[0000] worker.1 took 6.643812ms with stages: gas: 6.461126ms
INFO[0000] Can't run linter gas: panic occured: runtime error: invalid memory address or nil pointer dereference
INFO[0000] worker.2 took 15.14121ms with stages: megacheck: 15.117582ms
INFO[0000] Workers idle times: #1: 8.572497ms, #3: 13.38068ms, #4: 13.37371ms
INFO[0000] processing took 167.02µs with stages: max_same_issues: 163.107µs, max_from_linter: 1.24µs, path_prettifier: 970ns, diff: 838ns, exclude: 452ns, cgo: 246ns, max_per_file_from_linter: 67ns, uniq_by_line: 51ns, nolint: 49ns
Congrats! No issues were found.
INFO[0000] Extracting issued lines took 0s
INFO[0000] Memory: 1 samples, avg is 15.3MB, max is 15.3MB
INFO[0000] Execution took 21.079892ms

Shouldn't "/tmp/blank.go:1:1: expected 'package', found 'EOF'" be considered as an issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions