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

mark-rushakoff opened this issue May 28, 2019 · 1 comment


Copy link

@mark-rushakoff mark-rushakoff commented May 28, 2019

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.

Copy link

@bcmills bcmills commented May 28, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants