]> Cypherpunks repositories - gostls13.git/commit
cmd/go: ignore implicit imports when the -find flag is set
authorManlio Perillo <manlio.perillo@gmail.com>
Tue, 11 May 2021 15:02:20 +0000 (17:02 +0200)
committerJay Conrod <jayconrod@google.com>
Tue, 11 May 2021 21:22:08 +0000 (21:22 +0000)
commit9995c6b50aa55c1cc1236d1d688929df512dad53
tree65c08aac00e57fd0f009a55abf03dde5785536fc
parent9b84814f6e909bfe9054eab30e423bc5e880d137
cmd/go: ignore implicit imports when the -find flag is set

The documentation of the go list -find flag says that the Deps list will
be empty. However the current implementation adds implicit imports when
supporting Cgo or SWIG and when linking a main package.

Update the documentation of PackageOpts.IgnoreImport to clarify that
both explicit and implicit imports are ignored.

Add a regression test.

Fixes #46092

Change-Id: I37847528d84adb7a18eb6ff29e4af4b4318a66fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/318770
Trust: Jay Conrod <jayconrod@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/testdata/script/list_find_nodeps.txt [new file with mode: 0644]