From: ian woolf Date: Thu, 8 Apr 2021 12:42:47 +0000 (+0800) Subject: crypto/x509: replace os.MkdirTemp with T.TempDir X-Git-Tag: go1.17beta1~758 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8518aac3147da163ac5accfacbf0c30f684177e2;p=gostls13.git crypto/x509: replace os.MkdirTemp with T.TempDir Updates #45402 Change-Id: Ifb1fa5232a0fa1be62e886643cec9deaa3b312ad Reviewed-on: https://go-review.googlesource.com/c/go/+/308409 Reviewed-by: Ian Lance Taylor Reviewed-by: Emmanuel Odeke --- diff --git a/src/crypto/x509/root_unix_test.go b/src/crypto/x509/root_unix_test.go index 38038a65f3..7118f12d74 100644 --- a/src/crypto/x509/root_unix_test.go +++ b/src/crypto/x509/root_unix_test.go @@ -147,11 +147,7 @@ func TestLoadSystemCertsLoadColonSeparatedDirs(t *testing.T) { os.Setenv(certFileEnv, origFile) }() - tmpDir, err := os.MkdirTemp(os.TempDir(), "x509-issue35325") - if err != nil { - t.Fatalf("Failed to create temporary directory: %v", err) - } - defer os.RemoveAll(tmpDir) + tmpDir := t.TempDir() rootPEMs := []string{ geoTrustRoot,