We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found a testcase that causes a runtime panic in gci:
$ cat config/config_fuzz.go package config import ( // "os" ) $ gci config panic: runtime error: index out of range [-1] goroutine 1 [running]: github.com/daixiang0/gci/pkg/gci.(*pkg).fmt(0xc00011c0a0, 0x1, 0x1, 0x0) .../go/src/github.com/daixiang0/gci/pkg/gci/gci.go:130 +0xb0a github.com/daixiang0/gci/pkg/gci.processFile(0xc000126020, 0x15, 0x51fbc0, 0xc000128008, 0xc00011c040, 0x0, 0x0) .../go/src/github.com/daixiang0/gci/pkg/gci/gci.go:297 +0x33a github.com/daixiang0/gci/pkg/gci.visitFile.func1(0xc000126020, 0x15, 0x520b60, 0xc000110b60, 0x0, 0x0, 0x4aec7d, 0xc000110b60) .../go/src/github.com/daixiang0/gci/pkg/gci/gci.go:249 +0xb3 path/filepath.walk(0xc000126020, 0x15, 0x520b60, 0xc000110b60, 0xc000104290, 0x0, 0x0) .../go/go/src/path/filepath/path.go:360 +0x423 path/filepath.walk(0x7ffed58acf99, 0x6, 0x520b60, 0xc000110a90, 0xc000104290, 0x0, 0xc00010cec0) .../go/go/src/path/filepath/path.go:384 +0x2fe path/filepath.Walk(0x7ffed58acf99, 0x6, 0xc000104290, 0x0, 0x0) .../go/go/src/path/filepath/path.go:406 +0x105 github.com/daixiang0/gci/pkg/gci.WalkDir(0x7ffed58acf99, 0x6, 0xc00011c040, 0xc0001109c0, 0x0) .../go/src/github.com/daixiang0/gci/pkg/gci/gci.go:256 +0x4d main.main() .../go/src/github.com/daixiang0/gci/main.go:56 +0x1c5
AFAICS len(ret) is 0 in gci/pkg/gci/gci.go:
len(ret)
gci/pkg/gci/gci.go
130 if ret[len(ret)-1] == linebreak { 131 ret = ret[:len(ret)-1] 132 }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
I found a testcase that causes a runtime panic in gci:
AFAICS
len(ret)
is 0 ingci/pkg/gci/gci.go
:The text was updated successfully, but these errors were encountered: