1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:28:32 -06:00

go/packages/packagestest: change the Export method to take a testing.TB

This allows it to be used in benchmarks as well as tests.

Change-Id: I1eb7307a0a7d27c541b14dd8b84c4bc2c770f3c9
Reviewed-on: https://go-review.googlesource.com/c/150257
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Ian Cottrell 2018-11-19 11:24:30 -05:00
parent 139d099f66
commit 31e4346e36

View File

@ -103,7 +103,7 @@ func TestAll(t *testing.T, f func(*testing.T, Exporter)) {
// The file deletion in the cleanup can be skipped by setting the skip-cleanup
// flag when invoking the test, allowing the temporary directory to be left for
// debugging tests.
func Export(t *testing.T, exporter Exporter, modules []Module) *Exported {
func Export(t testing.TB, exporter Exporter, modules []Module) *Exported {
t.Helper()
dirname := strings.Replace(t.Name(), "/", "_", -1)
dirname = strings.Replace(dirname, "#", "_", -1) // duplicate subtests get a #NNN suffix.