aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/upload_content.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2021-10-13 22:38:58 -0700
committerGitHub <noreply@github.com>2021-10-13 22:38:58 -0700
commit5fd4b05c5ef2de1d49bfa35d42d4ac4f3bc9b068 (patch)
treebb21b4450e8611eed89d33dfdd46e4e6144bc00b /weed/operation/upload_content.go
parent46a09c60744eff104fdfc1a1fade38c5485f0dda (diff)
parenta23bcbb7ecf93fcda35976f4f2fb42a67830e718 (diff)
downloadseaweedfs-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/operation/upload_content.go')
-rw-r--r--weed/operation/upload_content.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index 33f6fba10..ade324005 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"mime"
"mime/multipart"
"net/http"
@@ -91,7 +90,7 @@ func doUpload(reader io.Reader, option *UploadOption) (uploadResult *UploadResul
if ok {
data = bytesReader.Bytes
} else {
- data, err = ioutil.ReadAll(reader)
+ data, err = io.ReadAll(reader)
if err != nil {
err = fmt.Errorf("read input: %v", err)
return
@@ -278,7 +277,7 @@ func upload_content(fillBufferFunction func(w io.Writer) error, originalDataSize
return &ret, nil
}
- resp_body, ra_err := ioutil.ReadAll(resp.Body)
+ resp_body, ra_err := io.ReadAll(resp.Body)
if ra_err != nil {
return nil, fmt.Errorf("read response body %v: %v", option.UploadUrl, ra_err)
}