From d4f6f273bc36d8ce376cd7aee794458011fee2e0 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 26 Apr 2024 15:24:28 +0800 Subject: chore: remove refs to deprecated io/ioutil Signed-off-by: guoguangwu chore: remove refs to deprecated io/ioutil Signed-off-by: guoguangwu --- bridge/github/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bridge/github/config.go') diff --git a/bridge/github/config.go b/bridge/github/config.go index 2f5d1f3b..9ae1d187 100644 --- a/bridge/github/config.go +++ b/bridge/github/config.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "regexp" @@ -233,7 +233,7 @@ func requestUserVerificationCode(scope string) (*githRespT, error) { return nil, fmt.Errorf("unexpected response status code %d from Github API", resp.StatusCode) } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return nil, errors.Wrap(err, "error requesting user verification code") } @@ -284,7 +284,7 @@ func pollGithubForAuthorization(deviceCode string, intervalSec int64) (string, e return "", fmt.Errorf("unexpected response status code %d from Github API", resp.StatusCode) } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { _ = resp.Body.Close() return "", errors.Wrap(err, "error polling the Github API") @@ -490,7 +490,7 @@ func validateUsername(username string) (bool, string, error) { return false, "", nil } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return false, "", err } -- cgit