refactor: move from io/ioutil to io and os packages (#5266)
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. [1]: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -19,7 +19,7 @@ package kiali
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -70,7 +70,7 @@ func TestClient_Get(t *testing.T) {
|
||||
args: args{url: "http://kiali.istio-system.svc"},
|
||||
wantResp: &http.Response{
|
||||
StatusCode: 200,
|
||||
Body: ioutil.NopCloser(bytes.NewReader([]byte("fake"))),
|
||||
Body: io.NopCloser(bytes.NewReader([]byte("fake"))),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
@@ -89,7 +89,7 @@ func TestClient_Get(t *testing.T) {
|
||||
args: args{url: "http://kiali.istio-system.svc"},
|
||||
wantResp: &http.Response{
|
||||
StatusCode: 200,
|
||||
Body: ioutil.NopCloser(bytes.NewReader([]byte("fake"))),
|
||||
Body: io.NopCloser(bytes.NewReader([]byte("fake"))),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
@@ -108,7 +108,7 @@ func TestClient_Get(t *testing.T) {
|
||||
args: args{url: "http://kiali.istio-system.svc"},
|
||||
wantResp: &http.Response{
|
||||
StatusCode: 200,
|
||||
Body: ioutil.NopCloser(bytes.NewReader([]byte("fake"))),
|
||||
Body: io.NopCloser(bytes.NewReader([]byte("fake"))),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user