refactor: move from io/ioutil to io and os package (#1772)

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 <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2021-09-27 08:55:23 +08:00
committed by GitHub
parent a2cce0ba77
commit 62af723017
25 changed files with 45 additions and 57 deletions

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"regexp"
"runtime"
@@ -129,7 +129,7 @@ func makeGithubRequest(url string, output interface{}) error {
defer response.Body.Close()
data, err := ioutil.ReadAll(response.Body)
data, err := io.ReadAll(response.Body)
if err != nil {
//lint:ignore ST1005 Github is a proper capitalized noun
return fmt.Errorf("Github API read response failed: %s", err)