chore: Drop deprecated io/ioutil

Signed-off-by: shuheiktgw <shuheiktgw@users.noreply.github.com>
This commit is contained in:
shuheiktgw
2021-07-31 08:25:46 +09:00
parent df459c5fe6
commit 38d3ca1022
17 changed files with 41 additions and 42 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
@@ -445,7 +445,7 @@ func TestScheduler_DaemonSetTargetPortName(t *testing.T) {
func TestScheduler_DaemonSetAlerts(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
b, err := io.ReadAll(r.Body)
require.NoError(t, err)
var payload = notifier.SlackPayload{}
err = json.Unmarshal(b, &payload)
+2 -2
View File
@@ -20,7 +20,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
@@ -596,7 +596,7 @@ func TestScheduler_DeploymentTargetPortName(t *testing.T) {
func TestScheduler_DeploymentAlerts(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
b, err := io.ReadAll(r.Body)
require.NoError(t, err)
var payload = notifier.SlackPayload{}
err = json.Unmarshal(b, &payload)
+2 -2
View File
@@ -22,7 +22,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strconv"
@@ -67,7 +67,7 @@ func callWebhook(webhook string, payload interface{}, timeout string) error {
}
defer r.Body.Close()
b, err := ioutil.ReadAll(r.Body)
b, err := io.ReadAll(r.Body)
if err != nil {
return fmt.Errorf("error reading body: %s", err.Error())
}