mirror of
https://github.com/rclone/rclone.git
synced 2025-08-16 16:41:34 +02:00
Replace deprecated ioutil
As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code.
This commit is contained in:
committed by
Nick Craig-Wood
parent
776e5ea83a
commit
5d6b8141ec
@ -11,7 +11,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@ -44,7 +43,7 @@ func NewClient(c *http.Client) *Client {
|
||||
// ReadBody reads resp.Body into result, closing the body
|
||||
func ReadBody(resp *http.Response) (result []byte, err error) {
|
||||
defer fs.CheckClose(resp.Body, &err)
|
||||
return ioutil.ReadAll(resp.Body)
|
||||
return io.ReadAll(resp.Body)
|
||||
}
|
||||
|
||||
// defaultErrorHandler doesn't attempt to parse the http body, just
|
||||
|
Reference in New Issue
Block a user