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