golangci / golangci-lint

Fast linters runner for Go
https://golangci-lint.run
GNU General Public License v3.0
15.66k stars 1.39k forks source link

gomodguard: Panic stack trace: goroutine 1 [running]:\nruntime/debug.Stack() & can't run linter goanalysis_metalinter: panic occurred #4242

Open honey-yogurt opened 11 months ago

honey-yogurt commented 11 months ago

Welcome

Description of the problem

This is my first time using golangci-lint, adding pre-commit to an existing project. My go.mod file is not in the root directory of the project. I used the pre-commit-hook project to apply golangci-lint. After renaming the directory where go.mod is located, I encountered a problem with the title. This is my project structure: image

Version of golangci-lint

```console $ golangci-lint --version golangci-lint has version v1.46.2 built from (unknown, mod sum: "h1:o90t/Xa6dhJbvy8Bz2RpzUXqrkigp19DLStMolTZbyo=") on (unknown) ```

Configuration

```console # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/golangci/golangci-lint rev: v1.55.2 hooks: - id: golangci-lint - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook rev: v9.10.0 hooks: - id: commitlint stages: [ commit-msg ] additional_dependencies: [ '@commitlint/config-conventional' ] ```

Go environment

```console $ go version && go env go version go1.20.7 windows/amd64 set GO111MODULE=on set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\DELL\AppData\Local\go-build set GOENV=C:\Users\DELL\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=C:\Users\DELL\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\DELL\go set GOPRIVATE= set GOPROXY=https://goproxy.cn,direct set GOROOT=C:\Program Files\Go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64 set GOVCS= set GOVERSION=go1.20.7 set GCCGO=gccgo set GOAMD64=v1 set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=NUL set GOWORK= set CGO_CFLAGS=-O2 -g set CGO_CPPFLAGS= set CGO_CXXFLAGS=-O2 -g set CGO_FFLAGS=-O2 -g set CGO_LDFLAGS=-O2 -g set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\DELL\AppData\Local\Temp\go-build3470650649=/tmp/go-build -gno-record-gcc-switches ```

Verbose output of running

```console $ golangci-lint cache clean $ golangci-lint run -v [WARNING] Unstaged files detected. [INFO] Stashing unstaged files to C:\Users\DELL\.cache\pre-commit\patch1702005891-24412. trim trailing whitespace.................................................Passed fix end of files.........................................................Passed check yaml...........................................(no files to check)Skipped check for added large files..............................................Passed golangci-lint............................................................Failed - hook id: golangci-lint - exit code: 3 level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." level=error msg="[runner] Panic stack trace: goroutine 1 [running]:\nruntime/debug.Stack()\n\tC:/Program Files/Go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/golangci/golangci-lint/pkg/lint.(*Runner).runLinterSafe.func1()\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/lint/runner.go:126 +0x28d\npanic({0x1b05560, 0x26657c0})\n\tC:/Program Files/Go/src/runtime/panic.go:884 +0x213\ngithub.com/ryancurrah/gomodguard.(*Processor).SetBlockedModules(0xc0023bbed8)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/golangenv-system/pkg/mod/github.com/ryancurrah/gomodguard@v1.3.0/processor.go:146 +0x5e\ngithub.com/ryancurrah/gomodguard.NewProcessor(0xc000a60540)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/golangenv-system/pkg/mod/github.com/ryancurrah/gomodguard@v1.3.0/processor.go:68 +0x170\ngithub.com/golangci/golangci-lint/pkg/golinters.NewGomodguard.func1(0xc0001ba770)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/golinters/gomodguard.go:68 +0x45\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*Linter).preRun(0xc000a39f80, 0xc00111f5e8?)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/golinters/goanalysis/linter.go:157 +0xe2\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.MetaLinter.Run({{0xc00068ec00, 0x25, 0x40}, 0xc000b7cf30}, {0xc00007c800?, 0xc0006869a0?}, 0x0?)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/golinters/goanalysis/metalinter.go:26 +0xa5\ngithub.com/golangci/golangci-lint/pkg/lint.(*Runner).runLinterSafe(0x3?, {0x1ecbe68?, 0xc000a59c50?}, 0xc0001ba770, 0xc000175900)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/lint/runner.go:131 +0xcf\ngithub.com/golangci/golangci-lint/pkg/lint.Runner.Run.func1()\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/lint/runner.go:215 +0x65\ngithub.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0007c4190, {0x1cd745f, 0x15}, 0xc00111f940)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/timeutils/stopwatch.go:111 +0x4a\ngithub.com/golangci/golangci-lint/pkg/lint.Runner.Run({{0xc0006869a0, 0x15, 0x15}, {0x1ed1750, 0xc0008b2060}}, {0x1ecbe68, 0xc000a59c50}, {0xc00000b378, 0x1, 0x1}, ...)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/lint/runner.go:214 +0x2ce\ngithub.com/golangci/golangci-lint/pkg/commands.(*Executor).runAnalysis(0xc000167200, {0x1ecbe68, 0xc000a59c50}, {0xc000a59bc0?, 0x45ec1606ad?, 0xc154c14c0e2e0334?})\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/commands/run.go:358 +0x611\ngithub.com/golangci/golangci-lint/pkg/commands.(*Executor).runAndPrint(0xc000167200, {0x1ecbe68, 0xc000a59c50}, {0xc000a59bc0, 0x0, 0x3})\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/commands/run.go:393 +0x1dd\ngithub.com/golangci/golangci-lint/pkg/commands.(*Executor).executeRun(0xc000167200, 0x0?, {0xc000a59bc0, 0x0, 0x3})\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/commands/run.go:510 +0x24f\ngithub.com/spf13/cobra.(*Command).execute(0xc000005200, {0xc000a59b60, 0x3, 0x3})\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/golangenv-system/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x847\ngithub.com/spf13/cobra.(*Command).ExecuteC(0xc000004f00)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/golangenv-system/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd\ngithub.com/spf13/cobra.(*Command).Execute(...)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/golangenv-system/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992\ngithub.com/golangci/golangci-lint/pkg/commands.(*Executor).Execute(...)\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/pkg/commands/executor.go:151\nmain.main()\n\tC:/Users/DELL/.cache/pre-commit/repoyc5ufnm2/cmd/golangci-lint/main.go:41 +0x1de\n" level=warning msg="[runner] Can't run linter goanalysis_metalinter: panic occurred: runtime error: invalid memory address or nil pointer dereference" level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: panic occurred: runtime error: invalid memory address or nil pointer dereference\n\n" [INFO] Restored changes from C:\Users\DELL\.cache\pre-commit\patch1702005891-24412. ```

A minimal reproducible example or link to a public repository

code: ```go package main import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "fmt" "net/http" "time" "github.com/gin-gonic/gin" ) func main() { r := gin.Default() r.GET("/health", func(c *gin.Context) { // 随便处理一些逻辑,以便于调试 start := time.Now() priv, err := randomPrivateKey() if err != nil { fmt.Println("err", err) } fmt.Printf("%+v \n", priv) fmt.Println("time-consuming", time.Now().Sub(start)) c.String(http.StatusOK, "I am ok!") }) r.Run(":8000") } func randomPrivateKey() (*ecdsa.PrivateKey, error) { // 选择椭圆曲线类型 curve := elliptic.P256() // 生成私钥 privateKey, err := ecdsa.GenerateKey(curve, rand.Reader) if err != nil { return nil, err } return privateKey, nil } ``` go.mod: ``` module delve go 1.20 require github.com/gin-gonic/gin v1.9.1 require ( github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.9.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) ```

Validation

boring-cyborg[bot] commented 11 months ago

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

honey-yogurt commented 11 months ago

I have updated golangci-lint to the latest version, but there are still the same errors.

golangci-lint has version v1.55.2 built with go1.20.7 from (unknown, mod sum: "h1:yllEIsSJ7MtlDBwDJ9IMBkyEUz2fYE0b5B8IUgO1oP8=") on (unknown)
Antonboom commented 11 months ago

@honey-yogurt, hi!

Looks like issue in gomodguard, not in golangci-lint.

Based on stacktrace, this line panics.

You could debug gomodguard separately running your example. Thanks

P.S. Also I am not sure that gomodguard supports nested modules, we need to check it.

honey-yogurt commented 11 months ago

@Antonboom thanks, I have submitted an issue on gomodguard.

https://github.com/ryancurrah/gomodguard/issues/40

ldez commented 11 months ago

I don't think there is a problem with gomodguard. golangci-lint should be run inside a module and not outside.

ryancurrah commented 11 months ago

Gomodguard does not support nested modules at the moment. Though that may change next year. I have not tested it outside of a module, I can do that and raise an error instead of panic.

chenyanchen commented 8 months ago

Serval projects are failded to execute golangci-lint run.

Logs:

Panic: interfacer: package \"itemfeature\" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference: goroutine 29347 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:108 +0x27c\npanic({0x16346c0?, 0x220b230?})\n\t/usr/local/go/src/runtime/panic.go:914 +0x21f\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func1(0xc009341040)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:61 +0x105\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func2({0x1a30fb8, 0xc0210daee0})\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:78 +0x94\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func3(0xc03a96b680)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:109 +0x112\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions(0xc0316c61a0)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:123 +0x362\nmvdan.cc/interfacer/check.(*Checker).Check(0xc014be1560)\n\t/go/pkg/mod/mvdan.cc/interfacer@v0.0.0-20180901003855-c20040233aed/check/check.go:143 +0x2d8\ngithub.com/golangci/golangci-lint/pkg/golinters.runInterfacer(0xc033c604e0)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/interfacer.go:63 +0x3f6\ngithub.com/golangci/golangci-lint/pkg/golinters.NewInterfacer.func1(0x16212a0?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/interfacer.go:26 +0x29\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc0066a0e90)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:190 +0xb13\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:112 +0x17\ngithub.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc001cc6190, {0x17c02f6, 0xa}, 0xc002248f48)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/timeutils/stopwatch.go:111 +0x44\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0x0?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:111 +0x7a\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc0066a0e90)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xa8\ncreated by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze in goroutine 966\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x205\n
Panic: interfacer: package \"merge\" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference: goroutine 26581 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:108 +0x27c\npanic({0x16346c0?, 0x220b230?})\n\t/usr/local/go/src/runtime/panic.go:914 +0x21f\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func1(0xc02be424e0)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:61 +0x105\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func2({0x1a30fb8, 0xc02bbd52d0})\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:78 +0x94\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func3(0xc004baa880)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:109 +0x112\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions(0xc034b15790)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:123 +0x362\nmvdan.cc/interfacer/check.(*Checker).Check(0xc027b23320)\n\t/go/pkg/mod/mvdan.cc/interfacer@v0.0.0-20180901003855-c20040233aed/check/check.go:143 +0x2d8\ngithub.com/golangci/golangci-lint/pkg/golinters.runInterfacer(0xc030da9930)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/interfacer.go:63 +0x3f6\ngithub.com/golangci/golangci-lint/pkg/golinters.NewInterfacer.func1(0x16212a0?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/interfacer.go:26 +0x29\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc006671280)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:190 +0xb13\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:112 +0x17\ngithub.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0020afc20, {0x17c02f6, 0xa}, 0xc016f96748)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/timeutils/stopwatch.go:111 +0x44\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0x0?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:111 +0x7a\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc006671280)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xa8\ncreated by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze in goroutine 1071\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x205\n
Panic: unparam: package \"mock_cache\" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference: goroutine 10433 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:108 +0x27c\npanic({0x16346c0?, 0x220b230?})\n\t/usr/local/go/src/runtime/panic.go:914 +0x21f\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func1(0xc01490c820)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:61 +0x105\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func2({0x1a30fb8, 0xc008717370})\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:78 +0x94\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions(0xc0221a40d0)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:131 +0x2c8\nmvdan.cc/unparam/check.(*Checker).Check(0xc011f45720)\n\t/go/pkg/mod/mvdan.cc/unparam@v0.0.0-20240104100049-c549a3470d14/check/check.go:230 +0x2b0\ngithub.com/golangci/golangci-lint/pkg/golinters.runUnparam(0xc00d8cdba0, 0xc000428c38)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/unparam.go:75 +0x1c7\ngithub.com/golangci/golangci-lint/pkg/golinters.NewUnparam.func1(0x16212a0?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/unparam.go:28 +0x2d\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc004fbf430)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:190 +0xb13\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:112 +0x17\ngithub.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc001ed9770, {0x17989bf, 0x7}, 0xc00267b748)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/timeutils/stopwatch.go:111 +0x44\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc001d09380?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:111 +0x7a\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc004fbf430)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xa8\ncreated by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze in goroutine 954\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x205\n
Panic: interfacer: package \"store_feature\" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference: goroutine 15902 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:108 +0x27c\npanic({0x16346c0?, 0x220b230?})\n\t/usr/local/go/src/runtime/panic.go:914 +0x21f\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func1(0xc00dedaea0)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:61 +0x105\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions.func2({0x1a30fb8, 0xc00b227700})\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:78 +0x94\ngolang.org/x/tools/go/ssa/ssautil.AllFunctions(0xc008eb5860)\n\t/go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/ssautil/visit.go:131 +0x2c8\nmvdan.cc/interfacer/check.(*Checker).Check(0xc0182c2180)\n\t/go/pkg/mod/mvdan.cc/interfacer@v0.0.0-20180901003855-c20040233aed/check/check.go:143 +0x2d8\ngithub.com/golangci/golangci-lint/pkg/golinters.runInterfacer(0xc0182bd790)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/interfacer.go:63 +0x3f6\ngithub.com/golangci/golangci-lint/pkg/golinters.NewInterfacer.func1(0x16212a0?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/interfacer.go:26 +0x29\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc0056d92d0)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:190 +0xb13\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:112 +0x17\ngithub.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc002676550, {0x17c02f6, 0xa}, 0xc003463748)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/timeutils/stopwatch.go:111 +0x44\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc0022067e0?)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_action.go:111 +0x7a\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc0056d92d0)\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xa8\ncreated by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze in goroutine 922\n\t/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.2/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x205\n
ldez commented 8 months ago

@chenyanchen can you open a new issue?