replace deprecated ioutil function calls

This commit is contained in:
Matthew Penner
2021-11-15 10:24:52 -07:00
parent be543ce3e0
commit d8df353ce8
14 changed files with 130 additions and 101 deletions

View File

@@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"strconv"
"strings"
@@ -224,9 +223,9 @@ func (r *Response) Read() ([]byte, error) {
return nil, errors.New("remote: attempting to read missing response")
}
if r.Response.Body != nil {
b, _ = ioutil.ReadAll(r.Response.Body)
b, _ = io.ReadAll(r.Response.Body)
}
r.Response.Body = ioutil.NopCloser(bytes.NewBuffer(b))
r.Response.Body = io.NopCloser(bytes.NewBuffer(b))
return b, nil
}