From c7e11f4bf20af3ab3a90c8d0692fd2f06b824a13 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 3 May 2024 11:54:30 -0400 Subject: [PATCH] test: remove unnecessary testing.T arg Since the MakePluginDir function takes the TestSuite as receiver, we don't need to additionally pass in a reference to testing.T, since the test suite already contains one instance, and offers a function to get it from. --- test/loading_test.go | 2 +- test/plugin_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/loading_test.go b/test/loading_test.go index 258d8b5f5..e31decb2c 100644 --- a/test/loading_test.go +++ b/test/loading_test.go @@ -7,7 +7,7 @@ import ( func (ts *PackerTestSuite) TestLoadingOrder() { t := ts.T() - pluginDir, cleanup := ts.MakePluginDir(t, "1.0.9", "1.0.10") + pluginDir, cleanup := ts.MakePluginDir("1.0.9", "1.0.10") defer cleanup() for _, command := range []string{"build", "validate"} { diff --git a/test/plugin_test.go b/test/plugin_test.go index c6c63c296..2d1e91af3 100644 --- a/test/plugin_test.go +++ b/test/plugin_test.go @@ -140,7 +140,9 @@ func currentDir() (string, error) { // packer will be able to use that directory for running its functions. // // Deletion of the directory is the caller's responsibility. -func (ts *PackerTestSuite) MakePluginDir(t *testing.T, pluginVersions ...string) (pluginTempDir string, cleanup func()) { +func (ts *PackerTestSuite) MakePluginDir(pluginVersions ...string) (pluginTempDir string, cleanup func()) { + t := ts.T() + var err error defer func() {