diff options
author | Bryan C. Mills <bcmills@google.com> | 2021-11-08 21:45:58 +0000 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2021-11-08 22:05:00 +0000 |
commit | 67e22941dfe1555d8597e48f49ff86d3be340a36 (patch) | |
tree | fcb416f92ed7b03bd2cb9cf1eb9c6469ec916519 /src/cmd/go/internal/modload/load.go | |
parent | 955f9f56bf21dca045c042a2a8998a2fc04117a4 (diff) | |
download | go-67e22941dfe1555d8597e48f49ff86d3be340a36.tar.gz go-67e22941dfe1555d8597e48f49ff86d3be340a36.zip |
Revert "cmd/go: add workspace pruning mode"
This reverts CL 357169.
Reason for revert: appears to be failing on longtest SlowBot.¹
¹https://storage.googleapis.com/go-build-log/a97c855b/linux-amd64-longtest_7c9857d4.log
Change-Id: I3b94395671db78ed5fb2fb1019e7199e4ffbd272
Reviewed-on: https://go-review.googlesource.com/c/go/+/362249
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/go/internal/modload/load.go')
-rw-r--r-- | src/cmd/go/internal/modload/load.go | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go index 83fcafead3..845bf2f8a2 100644 --- a/src/cmd/go/internal/modload/load.go +++ b/src/cmd/go/internal/modload/load.go @@ -1004,11 +1004,7 @@ func loadFromRoots(ctx context.Context, params loaderParams) *loader { } var err error - desiredPruning := pruningForGoVersion(ld.GoVersion) - if ld.requirements.pruning == workspace { - desiredPruning = workspace - } - ld.requirements, err = convertPruning(ctx, ld.requirements, desiredPruning) + ld.requirements, err = convertPruning(ctx, ld.requirements, pruningForGoVersion(ld.GoVersion)) if err != nil { ld.errorf("go: %v\n", err) } @@ -1250,24 +1246,6 @@ func (ld *loader) updateRequirements(ctx context.Context) (changed bool, err err continue } - if inWorkspaceMode() { - // In workspace mode / workspace pruning mode, the roots are the main modules - // rather than the main module's direct dependencies. The check below on the selected - // roots does not apply. - if mg, err := rs.Graph(ctx); err != nil { - return false, err - } else if _, ok := mg.RequiredBy(dep.mod); !ok { - // dep.mod is not an explicit dependency, but needs to be. - // See comment on error returned below. - pkg.err = &DirectImportFromImplicitDependencyError{ - ImporterPath: pkg.path, - ImportedPath: dep.path, - Module: dep.mod, - } - } - continue - } - if pkg.err == nil && cfg.BuildMod != "mod" { if v, ok := rs.rootSelected(dep.mod.Path); !ok || v != dep.mod.Version { // dep.mod is not an explicit dependency, but needs to be. |