aboutsummaryrefslogtreecommitdiff
path: root/weed/operation
diff options
context:
space:
mode:
Diffstat (limited to 'weed/operation')
-rw-r--r--weed/operation/chunked_file.go5
-rw-r--r--weed/operation/upload_content.go5
2 files changed, 4 insertions, 6 deletions
diff --git a/weed/operation/chunked_file.go b/weed/operation/chunked_file.go
index 0227db1bf..45068bbcc 100644
--- a/weed/operation/chunked_file.go
+++ b/weed/operation/chunked_file.go
@@ -4,9 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
- "github.com/chrislusf/seaweedfs/weed/pb"
"io"
- "io/ioutil"
"net/http"
"sort"
"sync"
@@ -14,6 +12,7 @@ import (
"google.golang.org/grpc"
"github.com/chrislusf/seaweedfs/weed/glog"
+ "github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/util"
)
@@ -108,7 +107,7 @@ func readChunkNeedle(fileUrl string, w io.Writer, offset int64, jwt string) (wri
return written, err
}
defer func() {
- io.Copy(ioutil.Discard, resp.Body)
+ io.Copy(io.Discard, resp.Body)
resp.Body.Close()
}()
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)
}