Skip to content

Commit df4ddcc

Browse files
committed
multi: replace ioutil.TempDir
1 parent caf2419 commit df4ddcc

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

htlcswitch/mock.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"encoding/binary"
88
"fmt"
99
"io"
10-
"io/ioutil"
1110
"net"
1211
"os"
1312
"path/filepath"
@@ -947,7 +946,7 @@ var _ ChannelLink = (*mockChannelLink)(nil)
947946
func newDB() (*channeldb.DB, func(), error) {
948947
// First, create a temporary directory to be used for the duration of
949948
// this test.
950-
tempDirName, err := ioutil.TempDir("", "channeldb")
949+
tempDirName, err := os.MkdirTemp("", "channeldb")
951950
if err != nil {
952951
return nil, nil, err
953952
}

lntest/bitcoind_common.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package lntest
66
import (
77
"errors"
88
"fmt"
9-
"io/ioutil"
109
"os"
1110
"os/exec"
1211
"path/filepath"
@@ -105,7 +104,7 @@ func newBackend(miner string, netParams *chaincfg.Params, extraArgs []string,
105104
return nil, nil, err
106105
}
107106

108-
tempBitcoindDir, err := ioutil.TempDir("", "bitcoind")
107+
tempBitcoindDir, err := os.MkdirTemp("", "bitcoind")
109108
if err != nil {
110109
return nil, nil,
111110
fmt.Errorf("unable to create temp directory: %w", err)

lntest/node/harness_node.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"errors"
1010
"fmt"
1111
"io"
12-
"io/ioutil"
1312
"os"
1413
"os/exec"
1514
"path/filepath"
@@ -824,7 +823,7 @@ func (hn *HarnessNode) BackupDB() error {
824823
}
825824
} else {
826825
// Backup files.
827-
tempDir, err := ioutil.TempDir("", "past-state")
826+
tempDir, err := os.MkdirTemp("", "past-state")
828827
if err != nil {
829828
return fmt.Errorf("unable to create temp db folder: %w",
830829
err)

0 commit comments

Comments
 (0)