mirror of https://github.com/Xhofe/alist
chore: remove refs to deprecated io/ioutil (#5519)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>pull/5526/head
parent
3d51845f57
commit
f904596cbc
|
@ -5,7 +5,6 @@ import (
|
|||
"crypto/x509"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
|
@ -44,7 +43,7 @@ func (d *GoogleDrive) refreshToken() error {
|
|||
gdsaFileThis := d.RefreshToken
|
||||
if gdsaFile.IsDir() {
|
||||
if len(d.ServiceAccountFileList) <= 0 {
|
||||
gdsaReadDir, gdsaDirErr := ioutil.ReadDir(d.RefreshToken)
|
||||
gdsaReadDir, gdsaDirErr := os.ReadDir(d.RefreshToken)
|
||||
if gdsaDirErr != nil {
|
||||
log.Error("read dir fail")
|
||||
return gdsaDirErr
|
||||
|
@ -76,7 +75,7 @@ func (d *GoogleDrive) refreshToken() error {
|
|||
}
|
||||
}
|
||||
|
||||
gdsaFileThisContent, err := ioutil.ReadFile(gdsaFileThis)
|
||||
gdsaFileThisContent, err := os.ReadFile(gdsaFileThis)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"sync"
|
||||
"testing"
|
||||
|
@ -169,7 +168,7 @@ func newDownloadRangeClient(data []byte) (*downloadCaptureClient, *int, *[]strin
|
|||
header := &http.Header{}
|
||||
header.Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", start, fin-1, len(data)))
|
||||
return &http.Response{
|
||||
Body: ioutil.NopCloser(bytes.NewReader(bodyBytes)),
|
||||
Body: io.NopCloser(bytes.NewReader(bodyBytes)),
|
||||
Header: *header,
|
||||
ContentLength: int64(len(bodyBytes)),
|
||||
}, nil
|
||||
|
|
Loading…
Reference in New Issue