mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-18 03:21:45 +02:00
channeldb: use T.TempDir
to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -2,7 +2,6 @@ package channeldb_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
@@ -843,13 +842,7 @@ func loadFwdPkgs(t *testing.T, db kvdb.Backend,
|
||||
// provided path is an empty, it will create a temp dir/file to use.
|
||||
func makeFwdPkgDB(t *testing.T, path string) kvdb.Backend { // nolint:unparam
|
||||
if path == "" {
|
||||
var err error
|
||||
path, err = ioutil.TempDir("", "fwdpkgdb")
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create temp path: %v", err)
|
||||
}
|
||||
|
||||
path = filepath.Join(path, "fwdpkg.db")
|
||||
path = filepath.Join(t.TempDir(), "fwdpkg.db")
|
||||
}
|
||||
|
||||
bdb, err := kvdb.Create(
|
||||
|
Reference in New Issue
Block a user