Skip to content

Commit b4e9071

Browse files
liran-funarotock-ibm
authored andcommitted
Use testing.TempDir()
Signed-off-by: Liran Funaro <liran.funaro@gmail.com>
1 parent 50ec7c0 commit b4e9071

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pkg/server/testutils/crypto_utils.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ func GenerateTestCrypto(t *testing.T, names []string, withIntermediateCA ...bool
166166
withInterCA = withIntermediateCA[0]
167167
}
168168

169-
tempDir, err := ioutil.TempDir("/tmp", "UnitTestCrypto")
170-
require.NoError(t, err)
171-
t.Cleanup(func() {
172-
os.RemoveAll(tempDir)
173-
})
169+
tempDir := t.TempDir()
174170

175171
rootCAPemCert, caPrivKey, err := GenerateRootCA("Orion RootCA", "127.0.0.1")
176172
require.NoError(t, err)

0 commit comments

Comments
 (0)