Skip to content

Commit 2350cdd

Browse files
committed
Get rid of io/ioutil
1 parent d32dfe5 commit 2350cdd

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

box.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"bytes"
66
"errors"
77
"fmt"
8-
"io/ioutil"
98
"net"
109
"os"
1110
"os/exec"
@@ -74,7 +73,7 @@ func NewBox(config string, options *BoxOptions) (*Box, error) {
7473
var box *Box
7574

7675
for port := options.PortMin; port <= options.PortMax; port++ {
77-
tmpDir, err := ioutil.TempDir("", options.LogNamePrefix)
76+
tmpDir, err := os.MkdirTemp("", options.LogNamePrefix)
7877
if err != nil {
7978
return nil, err
8079
}
@@ -204,7 +203,7 @@ func (box *Box) StartWithLua(luaTransform func(string) string) error {
204203
}
205204

206205
initLuaFile := path.Join(box.Root, "init.lua")
207-
err := ioutil.WriteFile(initLuaFile, []byte(initLua), 0644)
206+
err := os.WriteFile(initLuaFile, []byte(initLua), 0644)
208207
if err != nil {
209208
return err
210209
}

lastsnapvclock_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package tarantool
22

33
import (
4-
"io/ioutil"
54
"os"
65
"path/filepath"
76
"testing"
@@ -14,7 +13,7 @@ func TestLastSnapVClock(t *testing.T) {
1413
require := require.New(t)
1514

1615
guest, role, luaDir := "guest", "replication", "lua"
17-
luaInit, err := ioutil.ReadFile(filepath.Join("testdata", "init.lua"))
16+
luaInit, err := os.ReadFile(filepath.Join("testdata", "init.lua"))
1817
require.NoError(err)
1918
config := string(luaInit)
2019
config += schemeNewReplicator(tnt16User, tnt16Pass)

slave_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package tarantool
33
import (
44
"fmt"
55
"io"
6-
"io/ioutil"
6+
"os"
77
"path/filepath"
88
"strings"
99
"testing"
@@ -714,7 +714,7 @@ func TestSlaveLastSnapVClock(t *testing.T) {
714714

715715
// setup
716716
user, role, luaDir := "guest", "replication", "lua"
717-
luaInit, err := ioutil.ReadFile(filepath.Join("testdata", "init.lua"))
717+
luaInit, err := os.ReadFile(filepath.Join("testdata", "init.lua"))
718718
require.NoError(err)
719719
config := string(luaInit)
720720
config += schemeNewReplicator(tnt16User, tnt16Pass)

0 commit comments

Comments
 (0)