Skip to content

Commit

Permalink
server: replace ioutil.TempDir by os.MkdirTemp (#27226)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zheaoli authored Aug 16, 2021
1 parent d92c49f commit da8bb5e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/tidb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"database/sql"
"encoding/pem"
"fmt"
"io/ioutil"
"math/big"
"net/http"
"os"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit da8bb5e

Please sign in to comment.