This fixes the root cause of the bootstrap failure reported in
https://groups.google.com/d/msg/golang-dev/xcVJDj5GJ84/U0pVnUOnBwAJ.
Updates #30228
Change-Id: I9ce0898922a5aac1f61ceff30319cf88031676c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/167079
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
}
if cfg.BuildMod == "vendor" {
- walkPkgs(filepath.Join(ModRoot(), "vendor"), "", false)
+ if HasModRoot() {
+ modPrefix := Target.Path
+ if Target.Path == "std" {
+ modPrefix = ""
+ }
+ walkPkgs(ModRoot(), modPrefix, false)
+ walkPkgs(filepath.Join(ModRoot(), "vendor"), "", false)
+ }
return pkgs
}
! go list ...
go list -mod=vendor ...
+# However, it should still list packages in the main module.
+go list -mod=vendor m/...
+stdout m
+
-- go.mod --
module m