Replace deprecated ioutil package

This commit is contained in:
Paul van Brouwershaven
2023-02-20 15:46:37 +01:00
parent 9d4a20b926
commit 007b08d4d1
4 changed files with 13 additions and 14 deletions

View File

@@ -7,7 +7,6 @@ import (
"encoding/asn1"
"fmt"
"io"
"io/ioutil"
"os"
"reflect"
"time"
@@ -146,7 +145,7 @@ func Reader(file io.ReaderAt, size int64) (apiResp *Response, err error) {
// This content will be hashed with the corresponding algorithm to
// verify the signature.
content, err := ioutil.ReadAll(io.NewSectionReader(file, v.Key("ByteRange").Index(i-1).Int64(), v.Key("ByteRange").Index(i).Int64()))
content, err := io.ReadAll(io.NewSectionReader(file, v.Key("ByteRange").Index(i-1).Int64(), v.Key("ByteRange").Index(i).Int64()))
if err != nil {
apiResp.Error = fmt.Sprintln("Failed to get ByteRange:", i, err)
}