This commit is contained in:
Shikong 2023-07-24 08:37:37 +08:00
parent 450e4940b2
commit ac62099b73

View File

@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"mime"
"net/http"
@ -109,7 +108,7 @@ func (d *Downloader) downloadPart(c PartFile, f *os.File) error {
_ = Body.Close()
}(resp.Body)
bs, err := ioutil.ReadAll(resp.Body)
bs, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
@ -170,7 +169,7 @@ func (d *Downloader) Run() error {
if err != nil {
return err
}
fByte, err = ioutil.ReadAll(tmpFile)
fByte, err = io.ReadAll(tmpFile)
} else {
tmpFile, err = os.Create(path)
}