mvdan / gofumpt

A stricter gofmt
https://pkg.go.dev/mvdan.cc/gofumpt
BSD 3-Clause "New" or "Revised" License
3.15k stars 110 forks source link

panic: invalid semver string: "v1.22rc2" #292

Closed sonatard closed 5 months ago

sonatard commented 5 months ago

go.mod

go 1.22rc2
panic: invalid semver string: "v1.22rc2"

goroutine 20 [running]:
mvdan.cc/gofumpt/format.File(0x14000010080, 0x1400021c000, {{0x1400000ec40, 0x8}, {0x1400013a120, 0x22}, 0x1})
        /Users/xxx/go/pkg/mod/mvdan.cc/gofumpt@v0.5.0/format/format.go:97 +0x264
main.processFile({0x1400008c3c0, 0x54}, {0x1048bd480, 0x1400009e8f0}, {0x0?, 0x0?}, 0x0?, 0x0)
        /Users/xxx/go/pkg/mod/mvdan.cc/gofumpt@v0.5.0/gofmt.go:313 +0x20c
main.gofmtMain.func4.1(0x0?)
        /Users/xxx/go/pkg/mod/mvdan.cc/gofumpt@v0.5.0/gofmt.go:529 +0x40
main.(*sequencer).Add.func2()
        /Users/xxx/go/pkg/mod/mvdan.cc/gofumpt@v0.5.0/gofmt.go:191 +0x48
created by main.(*sequencer).Add in goroutine 1
        /Users/xxx/go/pkg/mod/mvdan.cc/gofumpt@v0.5.0/gofmt.go:190 +0x1a8
exit status 2
mvdan commented 5 months ago

See https://github.com/mvdan/gofumpt/issues/280. I will do a release soon, since this fix is only in master.