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,