mirror of
https://github.com/distribution/distribution.git
synced 2025-09-01 23:17:33 +00:00
replace deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
@@ -607,7 +606,7 @@ func (d *driver) GetContent(ctx context.Context, path string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ioutil.ReadAll(reader)
|
||||
return io.ReadAll(reader)
|
||||
}
|
||||
|
||||
// PutContent stores the []byte content at a location designated by "path".
|
||||
@@ -635,7 +634,7 @@ func (d *driver) Reader(ctx context.Context, path string, offset int64) (io.Read
|
||||
})
|
||||
if err != nil {
|
||||
if s3Err, ok := err.(awserr.Error); ok && s3Err.Code() == "InvalidRange" {
|
||||
return ioutil.NopCloser(bytes.NewReader(nil)), nil
|
||||
return io.NopCloser(bytes.NewReader(nil)), nil
|
||||
}
|
||||
|
||||
return nil, parseError(path, err)
|
||||
@@ -1356,7 +1355,7 @@ func (w *writer) Write(p []byte) (int, error) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
w.parts = nil
|
||||
w.readyPart, err = ioutil.ReadAll(resp.Body)
|
||||
w.readyPart, err = io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user