From da8bb5ea8c00bcbbb10afd0ae41a42fa7780d7f6 Mon Sep 17 00:00:00 2001 From: Manjusaka Date: Mon, 16 Aug 2021 09:55:58 +0800 Subject: [PATCH] server: replace `ioutil.TempDir` by `os.MkdirTemp` (#27226) --- server/tidb_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/tidb_test.go b/server/tidb_test.go index 1ac8924fb82d4..b6da1ace593f5 100644 --- a/server/tidb_test.go +++ b/server/tidb_test.go @@ -25,7 +25,6 @@ import ( "database/sql" "encoding/pem" "fmt" - "io/ioutil" "math/big" "net/http" "os" @@ -461,7 +460,7 @@ func (ts *tidbTestSuite) TestSocket(c *C) { func (ts *tidbTestSuite) TestSocketAndIp(c *C) { osTempDir := os.TempDir() - tempDir, err := ioutil.TempDir(osTempDir, "tidb-test.*.socket") + tempDir, err := os.MkdirTemp(osTempDir, "tidb-test.*.socket") c.Assert(err, IsNil) socketFile := tempDir + "/tidbtest.sock" // Unix Socket does not work on Windows, so '/' should be OK defer os.RemoveAll(tempDir) @@ -619,7 +618,7 @@ func (ts *tidbTestSuite) TestSocketAndIp(c *C) { // TestOnlySocket for server configuration without network interface for mysql clients func (ts *tidbTestSuite) TestOnlySocket(c *C) { osTempDir := os.TempDir() - tempDir, err := ioutil.TempDir(osTempDir, "tidb-test.*.socket") + tempDir, err := os.MkdirTemp(osTempDir, "tidb-test.*.socket") c.Assert(err, IsNil) socketFile := tempDir + "/tidbtest.sock" // Unix Socket does not work on Windows, so '/' should be OK defer os.RemoveAll(tempDir)