diff options
author | Bryan C. Mills <bcmills@google.com> | 2021-05-11 10:15:57 -0400 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2021-05-12 20:20:11 +0000 |
commit | 6db7480f5973ced97dfb08f949889e2ff108a492 (patch) | |
tree | 32882c93dfbf0721b5d572e24697c3e8ba9bdcb6 /src/cmd/go/internal/modload/buildlist.go | |
parent | f93b951f33add708d9e745e95a29ebe98f3e1255 (diff) | |
download | go-6db7480f5973ced97dfb08f949889e2ff108a492.tar.gz go-6db7480f5973ced97dfb08f949889e2ff108a492.zip |
cmd/go/internal/modload: in updateLazyRoots, do not require the main module explicitly
Fixes #46078
Change-Id: I8044dac717459f1eeae1d8381a6503f22f9f51ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/319009
Trust: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/buildlist.go')
-rw-r--r-- | src/cmd/go/internal/modload/buildlist.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/buildlist.go b/src/cmd/go/internal/modload/buildlist.go index 7a0cea405e..e5db41c748 100644 --- a/src/cmd/go/internal/modload/buildlist.go +++ b/src/cmd/go/internal/modload/buildlist.go @@ -815,7 +815,8 @@ func updateLazyRoots(ctx context.Context, direct map[string]bool, rs *Requiremen roots = make([]module.Version, 0, len(rs.rootModules)) rootsUpgraded = false - inRootPaths := make(map[string]bool, len(rs.rootModules)) + inRootPaths := make(map[string]bool, len(rs.rootModules)+1) + inRootPaths[Target.Path] = true for _, m := range rs.rootModules { if inRootPaths[m.Path] { // This root specifies a redundant path. We already retained the |