chore: switch from iouitil to io.ReadAll (#272)
removed a TODO: switch to io.ReadAll and drop go1.15 support
This commit is contained in:
parent
cdf2af6c2c
commit
df5a09f813
7 changed files with 15 additions and 20 deletions
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -60,7 +60,7 @@ func HttpRequest(client *http.Client, req *http.Request, response interface{}) e
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to read response body: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue