]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go/internal/modload: use "pruned" instead of "lazy" to describe pruned module...
authorBryan C. Mills <bcmills@google.com>
Fri, 27 Aug 2021 19:07:15 +0000 (15:07 -0400)
committerBryan C. Mills <bcmills@google.com>
Mon, 30 Aug 2021 20:08:45 +0000 (20:08 +0000)
commit61120c634cde434b78d9fcfe53a53aade58ef6be
tree245d5089853bf38a61268463fe791ab4bee306f9
parentaf9009a989d69d3f5560dc7bd8ccf1574ea6a519
cmd/go/internal/modload: use "pruned" instead of "lazy" to describe pruned module graphs

The level of support for pruning — not the lazy/eager loading behavior
— is the more fundamental property, and what matters in terms of what
invariants we need to maintain.

If the main module supports pruned module graphs we load its
dependencies lazily, and if it does not support pruned module graphs
we load its dependencies eagerly. However, in principle we could also
load the module graph lazily even in modules that do not support graph
pruning — we would just be more likely to overlook inconsistent
requirements introduced by hand-edits or bad VCS merges to the go.mod
file.

(After this change, a “lazy” module is just one in which we happen not
to have loaded the module graph, and an “eager” one is one in which we
happen to load the module graph more aggressively.)

Updates #36460
For #47397

Change-Id: I0d2ffd21acc913f72ff56b59a6bdc539ebc3d377
Reviewed-on: https://go-review.googlesource.com/c/go/+/345393
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>
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/edit.go
src/cmd/go/internal/modload/import_test.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/list.go
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/modload/modfile.go