use ioutil.TempDir for test directories

This commit is contained in:
vyzo 2021-03-02 10:53:24 +02:00
parent 35d466d847
commit 68213a92cb
2 changed files with 4 additions and 8 deletions

View File

@ -1,7 +1,7 @@
package splitstore package splitstore
import ( import (
"os" "io/ioutil"
"testing" "testing"
cid "github.com/ipfs/go-cid" cid "github.com/ipfs/go-cid"
@ -19,9 +19,7 @@ func TestBloomMarkSet(t *testing.T) {
func testMarkSet(t *testing.T, lsType string) { func testMarkSet(t *testing.T, lsType string) {
t.Helper() t.Helper()
path := "/tmp/markset-test" path, err := ioutil.TempDir("", "sweep-test.*")
err := os.MkdirAll(path, 0777)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@ -1,7 +1,7 @@
package splitstore package splitstore
import ( import (
"os" "io/ioutil"
"testing" "testing"
cid "github.com/ipfs/go-cid" cid "github.com/ipfs/go-cid"
@ -44,9 +44,7 @@ func testTrackingStore(t *testing.T, tsType string) {
} }
} }
path := "/tmp/markset-test" path, err := ioutil.TempDir("", "snoop-test.*")
err := os.MkdirAll(path, 0777)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }