htlcswitch: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
5 files changed
+43
-78
No files matched your search
@@ -3,7 +3,6 @@ package htlcswitch_test
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
@@ -624,11 +623,7 @@ func equalIgnoreLFD(c, c2 *htlcswitch.PaymentCircuit) bool {
|
||||
// will be created.
|
||||
func makeCircuitDB(t *testing.T, path string) *channeldb.DB {
|
||||
if path == "" {
|
||||
var err error
|
||||
path, err = ioutil.TempDir("", "circuitdb")
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create temp path: %v", err)
|
||||
}
|
||||
path = t.TempDir()
|
||||
}
|
||||
|
||||
db, err := channeldb.Open(path)
|
||||
|
||||
Reference in new issue
Block a user