Skip to content

Commit 11930bd

Browse files
rscgopherbot
authored andcommitted
go/packages: fix handling of NeedExportFile in go list
If we need the export file, can't use -find, which stops the go command too early. Change-Id: I82adca728e3e8a2435cddad14cfed97665ea4234 Reviewed-on: https://go-review.googlesource.com/c/tools/+/310510 Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Austin Clements <[email protected]> Auto-Submit: Russ Cox <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent e0095ae commit 11930bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/packages/golist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ func golistargs(cfg *Config, words []string) []string {
819819
fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0),
820820
// go list doesn't let you pass -test and -find together,
821821
// probably because you'd just get the TestMain.
822-
fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0),
822+
fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)),
823823
}
824824
fullargs = append(fullargs, cfg.BuildFlags...)
825825
fullargs = append(fullargs, "--")

0 commit comments

Comments
 (0)