Skip to content

Commit db6a81e

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
go/packages/packagestest: set Config.Logf if the test is run verbosely
The Config.Logf field enables debug logging in go/packages, which is exactly what we want when running a test in verbose mode to debug it. For golang/go#60650. Change-Id: I36b47e214860b5aec7c66042fc0ceb50c7062f1a Reviewed-on: https://go-review.googlesource.com/c/tools/+/502175 Reviewed-by: Michael Matloob <[email protected]> TryBot-Bypass: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent a01290f commit db6a81e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

go/packages/packagestest/export.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ func Export(t testing.TB, exporter Exporter, modules []Module) *Exported {
217217
written: map[string]map[string]string{},
218218
ExpectFileSet: token.NewFileSet(),
219219
}
220+
if testing.Verbose() {
221+
exported.Config.Logf = t.Logf
222+
}
220223
defer func() {
221224
if t.Failed() || t.Skipped() {
222225
exported.Cleanup()

0 commit comments

Comments
 (0)