summaryrefslogtreecommitdiff
path: root/src/cmd/api/goapi_test.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2020-09-14 10:19:47 -0400
committerBryan C. Mills <bcmills@google.com>2020-09-14 19:45:28 +0000
commit57646534297a9bd193e6aaa4239c98984f371b97 (patch)
tree2876a441c31ad88216e623a20f03f3c8131e9165 /src/cmd/api/goapi_test.go
parent14c7caae5074fdf0d97a3ad995e20c63e4065cbf (diff)
downloadgo-git-57646534297a9bd193e6aaa4239c98984f371b97.tar.gz
cmd/api: omit outside dependencies when listing the packages in "std"
As of CL 251159, when 'go list -deps std' is run within GOROOT/src, it treats the vendored external dependencies as real module dependencies, not standard-library "vendor/" packages (which still exist in that case, but are treated as distinct packages outside the "std" module). Fixes #41358 Updates #30241 Change-Id: Ic23eae9829d90e74a340d49ca9052e9191597410 Reviewed-on: https://go-review.googlesource.com/c/go/+/254738 Run-TryBot: Bryan C. Mills <bcmills@google.com> Trust: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/api/goapi_test.go')
-rw-r--r--src/cmd/api/goapi_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/api/goapi_test.go b/src/cmd/api/goapi_test.go
index eaccc5ceb5..24620a94af 100644
--- a/src/cmd/api/goapi_test.go
+++ b/src/cmd/api/goapi_test.go
@@ -216,3 +216,16 @@ func TestIssue29837(t *testing.T) {
}
}
}
+
+func TestIssue41358(t *testing.T) {
+ context := new(build.Context)
+ *context = build.Default
+ context.Dir = filepath.Join(context.GOROOT, "src")
+
+ w := NewWalker(context, context.Dir)
+ for _, pkg := range w.stdPackages {
+ if strings.HasPrefix(pkg, "vendor/") || strings.HasPrefix(pkg, "golang.org/x/") {
+ t.Fatalf("stdPackages contains unexpected package %s", pkg)
+ }
+ }
+}