chore(all): remove deprecated io/ioutil import

This commit is contained in:
Quentin McGaw
2022-08-24 19:39:55 +00:00
parent 062b6a276c
commit 8dfaebc737
8 changed files with 13 additions and 19 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"errors"
"io"
"io/ioutil"
"net/http"
"strings"
"testing"
@@ -32,11 +31,11 @@ func Test_fetchAPI(t *testing.T) {
},
"no server": {
responseStatus: http.StatusOK,
responseBody: ioutil.NopCloser(strings.NewReader(`{}`)),
responseBody: io.NopCloser(strings.NewReader(`{}`)),
},
"success": {
responseStatus: http.StatusOK,
responseBody: ioutil.NopCloser(strings.NewReader(`{"servers":[
responseBody: io.NopCloser(strings.NewReader(`{"servers":[
{"country":"Country1","city":"City A","isp":"xyz","is_active":true,"hostnames":{"openvpn":"hosta"}},
{"country":"Country2","city":"City B","isp":"abc","is_active":false,"hostnames":{"openvpn":"hostb"}}
]}`)),

View File

@@ -3,7 +3,7 @@ package updater
import (
"context"
"errors"
"io/ioutil"
"io"
"net"
"net/http"
"strings"
@@ -145,7 +145,7 @@ func Test_Updater_GetServers(t *testing.T) {
return &http.Response{
StatusCode: testCase.responseStatus,
Status: http.StatusText(testCase.responseStatus),
Body: ioutil.NopCloser(strings.NewReader(testCase.responseBody)),
Body: io.NopCloser(strings.NewReader(testCase.responseBody)),
}, nil
}),
}