Skip to content

Commit 1e54bca

Browse files
committed
cli/trust: remove deprecated io/ioutil and use t.TempDir()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 58cf16d commit 1e54bca

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cli/trust/trust_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package trust
22

33
import (
4-
"io/ioutil"
5-
"os"
64
"testing"
75

86
"github.com/docker/distribution/reference"
@@ -49,11 +47,7 @@ func TestGetDigest(t *testing.T) {
4947
}
5048

5149
func TestGetSignableRolesError(t *testing.T) {
52-
tmpDir, err := ioutil.TempDir("", "notary-test-")
53-
assert.NilError(t, err)
54-
defer os.RemoveAll(tmpDir)
55-
56-
notaryRepo, err := client.NewFileCachedRepository(tmpDir, "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{})
50+
notaryRepo, err := client.NewFileCachedRepository(t.TempDir(), "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{})
5751
assert.NilError(t, err)
5852
target := client.Target{}
5953
_, err = GetSignableRoles(notaryRepo, &target)

0 commit comments

Comments
 (0)