-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/tools/gopls: panic due to invalid semver tag (go1.21rc3) with gofumpt enabled #61692
Comments
That check in gofumpt has been there for over three years, so I wonder what has changed recently. LangVersion has always been documented as semver, thus the check. I also don't think it makes sense to give a beta or RC release as a language version. So I'm inclined to say it's working as intended, at least without understanding how we got here. |
@mvdan this is a result of a change in the Go command to record patch versions and release candidates in go.mod (#57001). LangVersion is documented to accept the version from the go.mod file: But that now fails:
|
FWIW, we'll preprocess this version in gopls so that it's acceptable to gofumpt. But it sounds like, based on the gofumpt documentation, this Go command change has broken you. (I'll note that the go.mod documentation prior to https://go.dev/cl/500775 was consistent with your interpretation of the |
Interesting, I hadn't realized that the format for the Is there any API to transform a Go release version into semver? I realise that #32450 was rejected, but I still want to be able to compute "is the user's language version 1.21 or higher", which is why I was using https://pkg.go.dev/golang.org/x/mod/semver#Compare until now. That happened to work with versions like |
Change https://go.dev/cl/514815 mentions this issue: |
gopls version: v0.13.1-pre.1 (go1.21rc3)
gopls flags:
update flags: proxy
extension version: 2023.7.1419
go version: 1.21rc3
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Tue, 01 Aug 2023 01:55:14 GMT
restart history:
Tue, 01 Aug 2023 01:51:13 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
reworking a scratch file to test an interface implementation. upon saving, there was a crash.
Please attach the stack trace from the crash.
A window with the error message should have popped up in the lower half of your screen.
Please copy the stack trace and error messages from that window and paste it in this issue.
Failed to auto-collect gopls trace: no gopls log.
The text was updated successfully, but these errors were encountered: