mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 03:43:36 +08:00
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
@@ -45,7 +44,7 @@ preparing test prerequisite easier )
|
||||
func TestMakeDiff(t *testing.T) {
|
||||
|
||||
v := new(Volume)
|
||||
//lastCompactIndexOffset value is the index file size before step 4
|
||||
// lastCompactIndexOffset value is the index file size before step 4
|
||||
v.lastCompactIndexOffset = 96
|
||||
v.SuperBlock.Version = 0x2
|
||||
/*
|
||||
@@ -63,7 +62,7 @@ func TestMakeDiff(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCompaction(t *testing.T) {
|
||||
dir, err := ioutil.TempDir("", "example")
|
||||
dir, err := os.MkdirTemp("", "example")
|
||||
if err != nil {
|
||||
t.Fatalf("temp dir creation: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user