Merge pull request #5973 from Juneezee/deprecate-ioutil
refactor: move from io/ioutil to io and os package
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
package metadata
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
)
|
||||
|
||||
func TestHasSharedLabel(t *testing.T) {
|
||||
tmpdir, err := ioutil.TempDir("", "bucket-testing-")
|
||||
tmpdir, err := os.MkdirTemp("", "bucket-testing-")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -64,7 +64,7 @@ func TestHasSharedLabel(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetShareableBucket(t *testing.T) {
|
||||
tmpdir, err := ioutil.TempDir("", "bucket-testing-")
|
||||
tmpdir, err := os.MkdirTemp("", "bucket-testing-")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package metadata
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
@@ -715,7 +714,7 @@ func testEnv(t *testing.T) (context.Context, *bolt.DB, func()) {
|
||||
ctx = namespaces.WithNamespace(ctx, "testing")
|
||||
ctx = logtest.WithT(ctx, t)
|
||||
|
||||
dirname, err := ioutil.TempDir("", strings.Replace(t.Name(), "/", "_", -1)+"-")
|
||||
dirname, err := os.MkdirTemp("", strings.Replace(t.Name(), "/", "_", -1)+"-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -74,7 +73,7 @@ func testDB(t *testing.T, opt ...testOpt) (context.Context, *DB, func()) {
|
||||
o(&topts)
|
||||
}
|
||||
|
||||
dirname, err := ioutil.TempDir("", strings.Replace(t.Name(), "/", "_", -1)+"-")
|
||||
dirname, err := os.MkdirTemp("", strings.Replace(t.Name(), "/", "_", -1)+"-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -765,7 +764,7 @@ type testLease struct {
|
||||
}
|
||||
|
||||
func newStores(t testing.TB) (*DB, content.Store, snapshots.Snapshotter, func()) {
|
||||
td, err := ioutil.TempDir("", "gc-test-")
|
||||
td, err := os.MkdirTemp("", "gc-test-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package metadata
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -389,7 +388,7 @@ func TestGCRefs(t *testing.T) {
|
||||
}
|
||||
|
||||
func newDatabase() (*bolt.DB, func(), error) {
|
||||
td, err := ioutil.TempDir("", "gc-roots-")
|
||||
td, err := os.MkdirTemp("", "gc-roots-")
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user