aboutsummaryrefslogtreecommitdiff
path: root/weed/server/volume_grpc_erasure_coding.go
diff options
context:
space:
mode:
authorEng Zer Jun <engzerjun@gmail.com>2021-10-14 12:27:58 +0800
committerEng Zer Jun <engzerjun@gmail.com>2021-10-14 12:27:58 +0800
commita23bcbb7ecf93fcda35976f4f2fb42a67830e718 (patch)
tree3227e82e51346dad8649a17e991c9cf561ef8071 /weed/server/volume_grpc_erasure_coding.go
parent4cbd390fbe634e2370c36a61b1574e9d648c3cee (diff)
downloadseaweedfs-a23bcbb7ecf93fcda35976f4f2fb42a67830e718.tar.xz
seaweedfs-a23bcbb7ecf93fcda35976f4f2fb42a67830e718.zip
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>
Diffstat (limited to 'weed/server/volume_grpc_erasure_coding.go')
-rw-r--r--weed/server/volume_grpc_erasure_coding.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go
index 653883c8e..72c65c04c 100644
--- a/weed/server/volume_grpc_erasure_coding.go
+++ b/weed/server/volume_grpc_erasure_coding.go
@@ -3,10 +3,7 @@ package weed_server
import (
"context"
"fmt"
- "github.com/chrislusf/seaweedfs/weed/pb"
- "github.com/chrislusf/seaweedfs/weed/storage/volume_info"
"io"
- "io/ioutil"
"math"
"os"
"path"
@@ -14,11 +11,13 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
+ "github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb"
"github.com/chrislusf/seaweedfs/weed/storage"
"github.com/chrislusf/seaweedfs/weed/storage/erasure_coding"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
"github.com/chrislusf/seaweedfs/weed/storage/types"
+ "github.com/chrislusf/seaweedfs/weed/storage/volume_info"
"github.com/chrislusf/seaweedfs/weed/util"
)
@@ -200,12 +199,12 @@ func (vs *VolumeServer) VolumeEcShardsDelete(ctx context.Context, req *volume_se
existingShardCount := 0
for _, location := range vs.store.Locations {
- fileInfos, err := ioutil.ReadDir(location.Directory)
+ fileInfos, err := os.ReadDir(location.Directory)
if err != nil {
continue
}
if location.IdxDirectory != location.Directory {
- idxFileInfos, err := ioutil.ReadDir(location.IdxDirectory)
+ idxFileInfos, err := os.ReadDir(location.IdxDirectory)
if err != nil {
continue
}