From 99489b3fb0475498c2b9da0055b8c60a055b6fc9 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Mon, 9 Oct 2023 17:26:46 +0800 Subject: [PATCH] chore: remove refs to deprecated io/ioutil --- wisdom/wisdom.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wisdom/wisdom.go b/wisdom/wisdom.go index fbc79ca..fd67f10 100644 --- a/wisdom/wisdom.go +++ b/wisdom/wisdom.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "math/rand" "net" "net/http" @@ -145,11 +144,11 @@ func query(reqURL *url.URL) ([]byte, error) { defer resp.Body.Close() if c := resp.StatusCode; c != http.StatusOK { - b, _ := ioutil.ReadAll(io.LimitReader(resp.Body, 2048)) + b, _ := io.ReadAll(io.LimitReader(resp.Body, 2048)) return nil, fmt.Errorf("api.open.wisdom.alphasoc.net said: %d: %s", c, b) } - b, err := ioutil.ReadAll(resp.Body) + b, err := io.ReadAll(resp.Body) if err != nil { return nil, errors.Wrapf(err, "api.open.wisdom.alphasoc.net read body error") }