-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/fix: fails to run on modules whose go directive value is in "1.n.m" format introduced in Go 1.21.0 #62584
Comments
so should I update my go version to 1.21 or newer? |
ok so the workarond is to edit the |
@heschi what do we need to do to merge linked PR? Thanks! |
The aforementioned PR is https://go.dev/cl/527342. Not sure why it didn't cross-reference here. 🤔 |
Change https://go.dev/cl/527342 mentions this issue: |
@gopherbot Please backport to Go 1.22. When I run
While |
Backport issue(s) opened: Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Apparently I can't create backport PRs myself (see #68825 (comment)) |
Change https://go.dev/cl/603981 mentions this issue: |
Support go version with patch release(e.g. 1.21.0) and release candidates(e.g. 1.21rc1) when parsing the go version in the fix command by using new "go/version" package. For #62584. Fixes #68825. Change-Id: I0ec16137c7a396c68039d374c770c4021fb54b4e GitHub-Last-Rev: 76bced5 GitHub-Pull-Request: #62586 Reviewed-on: https://go-review.googlesource.com/c/go/+/527342 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Alex Bozhenko <alexbozhenko@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 7fd62ba) Reviewed-on: https://go-review.googlesource.com/c/go/+/603981 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Bypass: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
According to my understanding of these docs:
https://go.dev/doc/go1.21#tools
https://go.dev/doc/toolchain#version
https://go.dev/ref/mod#go-mod-file-go
before go 1.21 it was not allowed to specify the patch version in the
go.mod
.so the code in fix cmd:
go/src/cmd/fix/main.go
Lines 78 to 79 in 905b58b
does not handle string
1.21.0
.Existing code also won't work with
go 1.21rc1
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Expected go fix to remove the deprecated build tag.
What did you see instead?
Error about invalid version.
The text was updated successfully, but these errors were encountered: