Remove deprecated io/ioutil (#15707)

This commit is contained in:
Klaus Post
2022-09-19 20:05:16 +02:00
committed by GitHub
parent 0b6175b742
commit ff12080ff5
89 changed files with 315 additions and 370 deletions
+3 -3
View File
@@ -22,7 +22,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"os"
"path/filepath"
"sort"
@@ -246,7 +246,7 @@ func (fs *FSObjects) NewMultipartUpload(ctx context.Context, bucket, object stri
return nil, err
}
if err = ioutil.WriteFile(pathJoin(uploadIDDir, fs.metaJSONFile), fsMetaBytes, 0o666); err != nil {
if err = os.WriteFile(pathJoin(uploadIDDir, fs.metaJSONFile), fsMetaBytes, 0o666); err != nil {
logger.LogIf(ctx, err)
return nil, err
}
@@ -525,7 +525,7 @@ func (fs *FSObjects) ListObjectParts(ctx context.Context, bucket, object, upload
}
defer rc.Close()
fsMetaBytes, err := ioutil.ReadAll(rc)
fsMetaBytes, err := io.ReadAll(rc)
if err != nil {
return result, toObjectErr(err, bucket, object)
}