mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
chore: Drop deprecated io/ioutil
Signed-off-by: shuheiktgw <shuheiktgw@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user