mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-29 03:01:52 +01:00
multi: replace ioutil.TempDir
This commit is contained in:
parent
caf2419ff6
commit
df4ddcc573
@ -7,7 +7,6 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -947,7 +946,7 @@ var _ ChannelLink = (*mockChannelLink)(nil)
|
|||||||
func newDB() (*channeldb.DB, func(), error) {
|
func newDB() (*channeldb.DB, func(), error) {
|
||||||
// First, create a temporary directory to be used for the duration of
|
// First, create a temporary directory to be used for the duration of
|
||||||
// this test.
|
// this test.
|
||||||
tempDirName, err := ioutil.TempDir("", "channeldb")
|
tempDirName, err := os.MkdirTemp("", "channeldb")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ package lntest
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -105,7 +104,7 @@ func newBackend(miner string, netParams *chaincfg.Params, extraArgs []string,
|
|||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
tempBitcoindDir, err := ioutil.TempDir("", "bitcoind")
|
tempBitcoindDir, err := os.MkdirTemp("", "bitcoind")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil,
|
return nil, nil,
|
||||||
fmt.Errorf("unable to create temp directory: %w", err)
|
fmt.Errorf("unable to create temp directory: %w", err)
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -824,7 +823,7 @@ func (hn *HarnessNode) BackupDB() error {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Backup files.
|
// Backup files.
|
||||||
tempDir, err := ioutil.TempDir("", "past-state")
|
tempDir, err := os.MkdirTemp("", "past-state")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to create temp db folder: %w",
|
return fmt.Errorf("unable to create temp db folder: %w",
|
||||||
err)
|
err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user