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

Go 1.12.5 and 1.13 conflict over go.mod #34135

Closed
bmhatfield opened this issue Sep 6, 2019 · 7 comments
Closed

Go 1.12.5 and 1.13 conflict over go.mod #34135

bmhatfield opened this issue Sep 6, 2019 · 7 comments

Comments

@bmhatfield
Copy link

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

go 1.13 and 1.12.5 (multiple individuals on the same team)

Does this issue reproduce with the latest release?

It's reproduced by the interplay between multiple releases, including the latest

What operating system and processor architecture are you using (go env)?

OSX 10.14 (all people / machines involved)

What did you do?

Checked in go.mod and go.sum after go get -u and go mod tidy

What did you expect to see?

No further updates to the module file

What did you see instead?

go 1.12.5 adds two indirect dependencies. If those are checked in, go 1.13 removes them. There's no stable module state these two versions of go can coexist.

go 1.13 removes these, go 1.12.5 always adds them back on any go build command.

% gd go.mod
diff --git a/go.mod b/go.mod
index 14f89a7e..3c18e2f2 100644
--- a/go.mod
+++ b/go.mod
@@ -35,8 +35,6 @@ require (
-       github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
-       github.com/modern-go/reflect2 v1.0.1 // indirect
@agnivade
Copy link
Contributor

agnivade commented Sep 6, 2019

@bcmills @thepudds @jayconrod

@lunny
Copy link

lunny commented Sep 6, 2019

Just encountered this issue.

@bcmills
Copy link
Contributor

bcmills commented Sep 6, 2019

This is due to the fix for #31248. You will likely find that 1.12.5's go mod tidy subcommand also removes these dependencies.

@bcmills
Copy link
Contributor

bcmills commented Sep 6, 2019

Duplicate of #31248

@bcmills bcmills marked this as a duplicate of #31248 Sep 6, 2019
@bcmills bcmills closed this as completed Sep 6, 2019
@bmhatfield
Copy link
Author

bmhatfield commented Sep 10, 2019

@bcmills I'm confused about closing/duping this against an issue that was closed on July 18th. I see no indication that this issue will be fixed in a release of Go? The issue referenced from #31248 also is closed and was closed around the time of 1.13beta1; I assume any fix here would have been released with 1.13?

This is becoming a huge problem for me. Every time I interact with Go I now end up fighting my VCS to undo the changes it's making to go.mod. Is there light at the end of the tunnel?

@bcmills
Copy link
Contributor

bcmills commented Sep 11, 2019

@bmhatfield, the fact that Go 1.12 and 1.13 produce different results is an intentional change resulting from the fix for #31248. The Go 1.13 result should, in general, be the correct one.

The workaround (during migration) is to always run go mod tidy with a consistent version of the go tool before commiting your change.

@bmhatfield
Copy link
Author

Ah, thank you for that clarification. I had misunderstood this as a new bug in go1.13, not a fix of a bug in go1.12, as I never noticed any ill effects in my go1.12/mod workflow.

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

5 participants