From 1e54bca833c093d9ae8f12e27770b197fcb0cece Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 25 Feb 2022 15:30:02 +0100 Subject: [PATCH] cli/trust: remove deprecated io/ioutil and use t.TempDir() Signed-off-by: Sebastiaan van Stijn --- cli/trust/trust_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cli/trust/trust_test.go b/cli/trust/trust_test.go index c49f41008f..044e2c2088 100644 --- a/cli/trust/trust_test.go +++ b/cli/trust/trust_test.go @@ -1,8 +1,6 @@ package trust import ( - "io/ioutil" - "os" "testing" "github.com/docker/distribution/reference" @@ -49,11 +47,7 @@ func TestGetDigest(t *testing.T) { } func TestGetSignableRolesError(t *testing.T) { - tmpDir, err := ioutil.TempDir("", "notary-test-") - assert.NilError(t, err) - defer os.RemoveAll(tmpDir) - - notaryRepo, err := client.NewFileCachedRepository(tmpDir, "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{}) + notaryRepo, err := client.NewFileCachedRepository(t.TempDir(), "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{}) assert.NilError(t, err) target := client.Target{} _, err = GetSignableRoles(notaryRepo, &target)