From e23fe4499b93bd863cf109baef766bb0031249ee Mon Sep 17 00:00:00 2001 From: web3-bot Date: Mon, 29 Aug 2022 14:25:59 +0000 Subject: [PATCH] stop using the deprecated io/ioutil package This commit was moved from ipfs/go-filestore@866d05c88c5e5f307864f6afcece8012eddcd009 --- filestore/filestore_test.go | 6 +++--- filestore/pb/dataobj.pb.go | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index 8117a2392..f3f3e64dd 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -3,8 +3,8 @@ package filestore import ( "bytes" "context" - "io/ioutil" "math/rand" + "os" "testing" dag "github.com/ipfs/go-merkledag" @@ -21,7 +21,7 @@ var bg = context.Background() func newTestFilestore(t *testing.T) (string, *Filestore) { mds := ds.NewMapDatastore() - testdir, err := ioutil.TempDir("", "filestore-test") + testdir, err := os.MkdirTemp("", "filestore-test") if err != nil { t.Fatal(err) } @@ -34,7 +34,7 @@ func newTestFilestore(t *testing.T) (string, *Filestore) { } func makeFile(dir string, data []byte) (string, error) { - f, err := ioutil.TempFile(dir, "file") + f, err := os.CreateTemp(dir, "file") if err != nil { return "", err } diff --git a/filestore/pb/dataobj.pb.go b/filestore/pb/dataobj.pb.go index 5ecc2489e..d342cabe5 100644 --- a/filestore/pb/dataobj.pb.go +++ b/filestore/pb/dataobj.pb.go @@ -5,10 +5,11 @@ package datastore_pb import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used.