Remplacer deprecated ioutil.ReadAll -> io.ReadAll

This commit is contained in:
Victor Lacasse-Beaudoin 2023-08-19 15:38:52 -04:00
parent 73b5ce1bc2
commit d4f26435e8

View file

@ -6,7 +6,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"mime/multipart" "mime/multipart"
"net/http" "net/http"
"net/url" "net/url"
@ -110,7 +109,7 @@ func (a *API) Call(method, route string) ([]byte, error) {
defer response.Body.Close() defer response.Body.Close()
body, err := ioutil.ReadAll(response.Body) body, err := io.ReadAll(response.Body)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -138,7 +137,7 @@ func (a *API) Call(method, route string) ([]byte, error) {
defer resp.Body.Close() defer resp.Body.Close()
// Read Response Body // Read Response Body
respBody, err := ioutil.ReadAll(resp.Body) respBody, err := io.ReadAll(resp.Body)
if err != nil { if err != nil {
return nil, err return nil, err
} }