Refactor: move from io/ioutil to io and os package (#2234)

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <zerjun@beatchain.co>
This commit is contained in:
Eng Zer Jun
2021-09-06 18:33:42 +08:00
committed by GitHub
parent f8ac24db27
commit 426aa7af34
49 changed files with 143 additions and 171 deletions
@@ -21,7 +21,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
@@ -67,7 +67,7 @@ func makeHTTPRequest(ctx context.Context, webhookEndPoint, method string, payloa
if requestErr != nil {
return requestErr
}
body, requestErr = ioutil.ReadAll(r.Body)
body, requestErr = io.ReadAll(r.Body)
if requestErr != nil {
return requestErr
}