diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2021-10-13 22:38:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-13 22:38:58 -0700 |
| commit | 5fd4b05c5ef2de1d49bfa35d42d4ac4f3bc9b068 (patch) | |
| tree | bb21b4450e8611eed89d33dfdd46e4e6144bc00b /weed/command/download.go | |
| parent | 46a09c60744eff104fdfc1a1fade38c5485f0dda (diff) | |
| parent | a23bcbb7ecf93fcda35976f4f2fb42a67830e718 (diff) | |
| download | seaweedfs-5fd4b05c5ef2de1d49bfa35d42d4ac4f3bc9b068.tar.xz seaweedfs-5fd4b05c5ef2de1d49bfa35d42d4ac4f3bc9b068.zip | |
Merge pull request #2381 from Juneezee/deprecate-ioutil
refactor: move from io/ioutil to io and os package
Diffstat (limited to 'weed/command/download.go')
| -rw-r--r-- | weed/command/download.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/weed/command/download.go b/weed/command/download.go index 1d8a72d31..a3c05b53d 100644 --- a/weed/command/download.go +++ b/weed/command/download.go @@ -2,17 +2,17 @@ package command import ( "fmt" - "github.com/chrislusf/seaweedfs/weed/pb" - "github.com/chrislusf/seaweedfs/weed/security" - "google.golang.org/grpc" "io" - "io/ioutil" "net/http" "os" "path" "strings" + "google.golang.org/grpc" + "github.com/chrislusf/seaweedfs/weed/operation" + "github.com/chrislusf/seaweedfs/weed/pb" + "github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/util" ) @@ -82,7 +82,7 @@ func downloadToFile(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOpti } defer f.Close() if isFileList { - content, err := ioutil.ReadAll(rc.Body) + content, err := io.ReadAll(rc.Body) if err != nil { return err } @@ -119,7 +119,7 @@ func fetchContent(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOption return "", nil, e } defer util.CloseResponse(rc) - content, e = ioutil.ReadAll(rc.Body) + content, e = io.ReadAll(rc.Body) return } |
