-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
unexpected lint panic error in newest version v1.63.0 #5271
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
Labels
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
@oowl can you provide a reproducible example? and your configuration. |
@ldez check the code below can reproduce it.
|
can you provide a complete reproducible example? |
Let's follow this shell snippet for reproduce it. $ /tmp cat process.go
package process
/*
#include <asm/types.h>
#include <sys/socket.h>
#include <linux/netlink.h>
#include <linux/inet_diag.h>
*/
import "C" run:
skip-dirs-use-default: true
timeout: 10m
output:
formats: colored-line-number
linters-settings:
gosmiple:
checks: ["all"]
linters:
enable:
- asasalint
- asciicheck
- bidichk
- contextcheck
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- copyloopvar
- forbidigo
- ginkgolinter
- gocheckcompilerdirectives
- goconst
- gocritic
- goimports
- gofmt
- gofumpt
- gosec
- gosimple
- govet
- ineffassign
- loggercheck
- misspell
- prealloc
- predeclared
- rowserrcheck
- revive
- staticcheck
- unused
issues:
exclude-use-default: true
exclude-dirs:
- tunnel/tun2socks
- store% $ /tmp /snap/bin/golangci-lint run --fix ./process.go
WARN [config_reader] The configuration option `run.skip-dirs-use-default` is deprecated, please use `issues.exclude-dirs-use-default`.
WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.17) of your project is lower than Go 1.22
ERRO [runner] Panic: gofumpt: package "process" (isInitialPkg: true, needAnalyzeSource: true): invalid line number 36 (should be < 35): goroutine 1188 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func1()
github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:50 +0x277
panic({0x11c1640?, 0xc001803ea0?})
runtime/panic.go:785 +0x132
go/token.(*File).LineStart(0x1?, 0xc000721400?)
go/token/position.go:232 +0x168
github.com/golangci/golangci-lint/pkg/golinters/internal.toDiagnostic(0xc001068660, {0x24, 0x24, {0x0, 0x0, 0x0}}, 0x0)
github.com/golangci/golangci-lint/pkg/golinters/internal/diff.go:254 +0x85
github.com/golangci/golangci-lint/pkg/golinters/internal.ExtractDiagnosticFromPatch(0xc00192a380, 0xc0008465a0, {0xc000675c00, 0x30b}, 0xc00007eae0)
github.com/golangci/golangci-lint/pkg/golinters/internal/diff.go:245 +0x4a5
github.com/golangci/golangci-lint/pkg/golinters/gofumpt.runGofumpt(0xc00007eae0, 0xc00192a380, {0x16926e0, 0x21b8740}, {{0xc0007087c0, 0x6}, {0x0, 0x0}, 0x0})
github.com/golangci/golangci-lint/pkg/golinters/gofumpt/gofumpt.go:86 +0x449
github.com/golangci/golangci-lint/pkg/golinters/gofumpt.New.func1.1(0x4106fe?)
github.com/golangci/golangci-lint/pkg/golinters/gofumpt/gofumpt.go:52 +0x3d
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyze.func3(0xc0028633e0, 0xc00192a380)
github.com/golangci/golangci-lint/pkg/goanalysis/runner_checker.go:182 +0xeb
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyze(0xc0028633e0)
github.com/golangci/golangci-lint/pkg/goanalysis/runner_checker.go:208 +0xa9c
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc000955360, {0x13b98e0, 0x7}, 0xc001139748)
github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe(0x0?)
github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:54 +0x71
github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze.func2(0xc0028633e0)
github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:83 +0xa5
created by github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze in goroutine 621
github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:78 +0x1e9
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: gofumpt: package "process" (isInitialPkg: true, needAnalyzeSource: true): invalid line number 36 (should be < 35)
ERRO Running error: can't run linter goanalysis_metalinter
goanalysis_metalinter: gofumpt: package "process" (isInitialPkg: true, needAnalyzeSource: true): invalid line number 36 (should be < 35) |
Merged
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Welcome
typecheck
section of the FAQ.Description of the problem
When I upgraded
golangci-lint
to the latest version, the following unexpected error occurred. suppose I downgrade it to v1.62.x version, the error message was gone as expected.Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
Validation
Supporter
The text was updated successfully, but these errors were encountered: