replace deprecated io/ioutil

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-11-02 22:55:22 +01:00
parent e3509fc1de
commit f8b3af78fc
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
33 changed files with 113 additions and 202 deletions

View file

@ -25,7 +25,6 @@ import (
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"
@ -336,7 +335,7 @@ func (d *driver) Reader(ctx context.Context, path string, offset int64) (io.Read
return nil, storagedriver.PathNotFoundError{Path: path}
}
if swiftErr, ok := err.(*swift.Error); ok && swiftErr.StatusCode == http.StatusRequestedRangeNotSatisfiable {
return ioutil.NopCloser(bytes.NewReader(nil)), nil
return io.NopCloser(bytes.NewReader(nil)), nil
}
return file, err
}