-
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/go: add a '-go' flag to 'go mod tidy' #45094
Comments
Is this going to happen for 1.17? |
Yes, I still plan to get this in for 1.17. (It should be a small change, and makes the migration path much smoother for #36460.) |
Change https://golang.org/cl/315210 mentions this issue: |
Change https://golang.org/cl/321069 mentions this issue: |
…re Go versions For #46141 Updates #45094 Change-Id: I6553600c69273762a81795ef021c66f4e0872b6b Reviewed-on: https://go-review.googlesource.com/c/go/+/321069 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
I've been considering the migration paths for lazy loading (#36460).
When lazy loading lands, if users merely run
go mod edit -go=1.17
and thengo build
, the build will in many cases fail due to missing transitive dependencies: Go 1.16 modules don't necessarily already satisfy the lazy loading invariants. Similarly, if users instead rungo mod edit -go=1.17 && go mod tidy
, they may find that the selected versions of transitive dependencies have changed: relevant transitive requirements that were previously implicit may be pruned out entirely by lazy loading.To ease the transition, I suggest that we add a
-go
flag togo mod tidy
. It would function analogous to the-go
flag togo mod tidy
, asgo mod tidy -go=1.17
. Specifically, it would causego mod tidy
to:go
version is already present in thego.mod
file.all
package pattern per thego
version indicated by the-go
flag, using the module graph from (1).go.mod
andgo.sum
files with thego
version indicated by the-go
flag, recording the dependencies used in (2).The implementation work for this approach would be fairly minimal, and it would allow users to adopt lazy loading without any changes to the selected versions of relevant modules.
CC @jayconrod @matloob @rsc
The text was updated successfully, but these errors were encountered: