Closed
Description
In https://github.com/daixiang0/kubeedge/tree/test-ci, edge/pkg/servicebus/config/config.go
has an obvious issue, while do not detect it.
- Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've included all information below (version, config, etc).
Please include the following information:
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.30.0 built from 45b90f6 on 2020-08-03T03:10:34Z
Go environment
$ go version && go env
go version go1.14.4 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/gopkg"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,https://proxy.golang.org,https://goproxy.io,direct"
GOROOT="/root/go"
GOSUMDB="gosum.io+ce6e7565+AY5qEHUk/qmHc5btzW45JVoENfazw8LielDsaI+lEbq6"
GOTMPDIR=""
GOTOOLDIR="/root/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/root/gopkg/src/github.com/daixiang0/222/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build843064397=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 9 linters: [errcheck gci goconst gofmt golint gosimple govet misspell whitespace]
INFO [loader] Go packages loading at mode 575 (exports_file|files|types_sizes|compiled_files|deps|imports|name) took 1.817608286s
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 45.374535ms
INFO [linters context/goanalysis] analyzers took 3m17.892640749s with top 10 stages: buildir: 2m59.131177356s, inspect: 4.870618839s, gci: 2.039499399s, printf: 1.894351344s, ctrlflow: 1.799971088s, gofmt: 987.955193ms, golint: 702.840023ms, misspell: 605.146607ms, whitespace: 365.885053ms, S1038: 255.550992ms
WARN [linters context] Panic: buildir: package "mappercommon" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference: goroutine 21927 [running]:
runtime/debug.Stack(0x10fea98, 0x3c, 0xc008def0d8)
/opt/hostedtoolcache/go/1.14.6/x64/src/runtime/debug/stack.go:24 +0x9d
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1(0xc002189880)
/home/runner/work/golangci-lint/golangci-lint/pkg/golinters/goanalysis/runner.go:508 +0x1b5
panic(0xf188a0, 0x1a0edb0)
/opt/hostedtoolcache/go/1.14.6/x64/src/runtime/panic.go:969 +0x166
honnef.co/go/tools/ir.postDomFrontier.add(...)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/lift.go:103
honnef.co/go/tools/ir.postDomFrontier.build(0xc001a97380, 0x8, 0x8, 0xc008dcd680)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/lift.go:112 +0x8f
honnef.co/go/tools/ir.buildPostDomFrontier(...)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/lift.go:122
honnef.co/go/tools/ir.lift(0xc008dcd680)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/lift.go:208 +0x523
honnef.co/go/tools/ir.(*Function).finishBody(0xc008dcd680)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/func.go:565 +0x36c
honnef.co/go/tools/ir.(*builder).buildFunction(0xc008defa68, 0xc008dcd680)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/builder.go:2313 +0x477
honnef.co/go/tools/ir.(*builder).buildFuncDecl(0xc008defa68, 0xc00804ba70, 0xc00b052540)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/builder.go:2334 +0xfa
honnef.co/go/tools/ir.(*Package).build(0xc00804ba70)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/builder.go:2440 +0xcb8
sync.(*Once).doSlow(0xc00804bac8, 0xc00863dbd0)
/opt/hostedtoolcache/go/1.14.6/x64/src/sync/once.go:66 +0xec
sync.(*Once).Do(...)
/opt/hostedtoolcache/go/1.14.6/x64/src/sync/once.go:57
honnef.co/go/tools/ir.(*Package).Build(0xc00804ba70)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/ir/builder.go:2358 +0x65
honnef.co/go/tools/internal/passes/buildir.run(0xc016546f00, 0x43bbc0ae0, 0x1b1d5a0, 0xc0025e04c8, 0x2)
/home/runner/go/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.4/internal/passes/buildir/buildir.go:89 +0x290
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc002189880)
/home/runner/work/golangci-lint/golangci-lint/pkg/golinters/goanalysis/runner.go:590 +0xa25
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
/home/runner/work/golangci-lint/golangci-lint/pkg/golinters/goanalysis/runner.go:512 +0x2a
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0018e73b0, 0x10519e5, 0x7, 0xc0042bd770)
/home/runner/work/golangci-lint/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x50
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc002189880)
/home/runner/work/golangci-lint/golangci-lint/pkg/golinters/goanalysis/runner.go:511 +0x91
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc000f924b0, 0xc002189880)
/home/runner/work/golangci-lint/golangci-lint/pkg/golinters/goanalysis/runner.go:1059 +0x61
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
/home/runner/work/golangci-lint/golangci-lint/pkg/golinters/goanalysis/runner.go:1054 +0x306
INFO [runner] processing took 6.139µs with stages: max_same_issues: 1.002µs, nolint: 740ns, skip_dirs: 545ns, path_prefixer: 470ns, source_code: 455ns, diff: 439ns, cgo: 336ns, max_from_linter: 299ns, uniq_by_line: 253ns, filename_unadjuster: 251ns, skip_files: 242ns, autogenerated_exclude: 238ns, path_prettifier: 230ns, identifier_marker: 160ns, exclude: 93ns, exclude-rules: 81ns, max_per_file_from_linter: 80ns, path_shortener: 79ns, severity-rules: 76ns, sort_results: 70ns
INFO [runner] linters took 1m2.120662367s with stages: goanalysis_metalinter: 1m2.120603939s
INFO File cache stats: 439 entries of total size 2.2MiB
INFO Memory: 461 samples, avg is 955.9MB, max is 1223.8MB
INFO Execution took 1m3.991158686s