mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 02:02:10 +02:00
kvdb: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package kvdb
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
@@ -16,19 +14,12 @@ type boltFixture struct {
|
||||
}
|
||||
|
||||
func NewBoltFixture(t *testing.T) *boltFixture {
|
||||
tempDir, err := ioutil.TempDir("", "test")
|
||||
require.NoError(t, err)
|
||||
|
||||
return &boltFixture{
|
||||
t: t,
|
||||
tempDir: tempDir,
|
||||
tempDir: t.TempDir(),
|
||||
}
|
||||
}
|
||||
|
||||
func (b *boltFixture) Cleanup() {
|
||||
os.RemoveAll(b.tempDir)
|
||||
}
|
||||
|
||||
func (b *boltFixture) NewBackend() walletdb.DB {
|
||||
dbPath := filepath.Join(b.tempDir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user