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: go version is added even when there are no other changes #32889

Closed
rogpeppe opened this issue Jul 2, 2019 · 1 comment
Closed

cmd/go: go version is added even when there are no other changes #32889

rogpeppe opened this issue Jul 2, 2019 · 1 comment

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented Jul 2, 2019

Under Go 1.12.6, compiling this program will leave the go.mod file untouched. Under Go tip (go version devel +d410642f49 Mon Jul 1 21:30:23 2019 +0000 linux/amd64), a go 1.13 line is added to the end of the go.mod file.

This is annoying when compiling older Go programs, as it always leaves the repository dirty, so doing:

 git checkout oldversion
 go build

will require a git reset --hard, even though the go.mod file was fully resolved.

I'd like to suggest that if the versions remain unchanged (as they should with MVS), the go.mod file should remain unchanged too.

@bcmills
Copy link
Contributor

bcmills commented Jul 2, 2019

That's what we did for #30790, but not how the go directive was intended to work. See #31960.

@bcmills bcmills closed this as completed Jul 2, 2019
@golang golang locked and limited conversation to collaborators Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants