1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-17 07:40:10 +00:00

bump Go to 1.19 and fix errores golangci-lint reports

This commit is contained in:
Jiaqi Luo
2022-12-02 17:04:02 -07:00
parent a17959b3b8
commit 5d579d3486
8 changed files with 74 additions and 47 deletions

View File

@@ -8,7 +8,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
@@ -93,7 +92,7 @@ func IsNotFound(err error) bool {
}
func NewAPIError(resp *http.Response, url string) *APIError {
contents, err := ioutil.ReadAll(resp.Body)
contents, err := io.ReadAll(resp.Body)
var body string
if err != nil {
body = "Unreadable body."
@@ -273,7 +272,7 @@ func NewAPIClient(opts *ClientOpts) (APIBaseClient, error) {
}
var schemas types.SchemaCollection
bytes, err := ioutil.ReadAll(resp.Body)
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return result, err
}