Skip to content
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/go: on malformed "go mod edit -go", suggest current version of go, not hardcoded 1.12 #32286

Closed
mark-rushakoff opened this issue May 28, 2019 · 2 comments
Labels
Documentation FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mark-rushakoff
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version devel +0f897f916a Tue May 28 02:52:39 2019 +0000 darwin/amd64

Does this issue reproduce with the latest release?

n/a, go mod edit suggests -go 1.12 on go1.12.5.

What did you do?

I wasn't sure if there was a way to go mod edit to put the go 1.12 directive in the "right" place in 1.12, prior to #31960 on tip, so I ran with a garbage argument to -go. This command has the same output in 1.12 and tip:

$  go mod edit -go=x
go mod: invalid -go option; expecting something like "-go 1.12"

What did you expect to see?

I expected the output to suggest -go 1.13 when running with tip.

What did you see instead?

It suggested -go 1.12, which seems odd given that I am running what is going to be 1.13.

I suppose there's an argument to suggest 1.12 as a "downgrading" case when go.mod already provides go 1.13, but the argument to use -go 1.13 to upgrade from a go 1.12 in go.mod seems just as valid.

@bcmills
Copy link
Contributor

bcmills commented May 28, 2019

The “something like” phrase in that error message is critical. 🙂

@bcmills bcmills added Documentation modules NeedsFix The path to resolution is known, but the work has not been done. labels May 28, 2019
@bcmills bcmills added this to the Unplanned milestone May 28, 2019
@bcmills
Copy link
Contributor

bcmills commented Jun 17, 2021

Fixed in CL 321069.

@bcmills bcmills closed this as completed Jun 17, 2021
@bcmills bcmills self-assigned this Jun 17, 2021
@bcmills bcmills modified the milestones: Unplanned, Go1.17 Jun 17, 2021
@golang golang locked and limited conversation to collaborators Jun 17, 2022
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants