chore: remove refs to deprecated io/ioutil

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
guoguangwu
2023-10-19 11:05:38 +08:00
parent 958b0671bd
commit 115e48a202
12 changed files with 56 additions and 59 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ package http
import (
"encoding/json"
"errors"
"io/ioutil"
"io"
"net/http"
"github.com/BBVA/kapow/internal/server/httperror"
@@ -28,7 +28,7 @@ import (
// Reason returns the reason phrase embedded within the JSON error
// body, or an error if no reason can be extracted
func Reason(r *http.Response) (string, error) {
body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
if err != nil {
return "", errors.New("error reading response's body")
}