Skip to content

Commit

Permalink
Remove deprecated pkg ioutil from test
Browse files Browse the repository at this point in the history
  • Loading branch information
khrm authored and tekton-robot committed Feb 23, 2023
1 parent 5f98209 commit 4bb9457
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package test

import (
"fmt"
"io/ioutil"
"os"
"testing"

corev1 "k8s.io/api/core/v1"
Expand All @@ -30,7 +30,7 @@ import (
func ConfigMapFromTestFile(t *testing.T, name string) *corev1.ConfigMap {
t.Helper()

b, err := ioutil.ReadFile(fmt.Sprintf("testdata/%s.yaml", name))
b, err := os.ReadFile(fmt.Sprintf("testdata/%s.yaml", name))
if err != nil {
t.Fatalf("ReadFile() = %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions test/eventlistener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
Expand Down Expand Up @@ -68,7 +68,7 @@ const (
func loadExamplePREventBytes(t *testing.T) []byte {
t.Helper()
path := filepath.Join("testdata", examplePRJsonFilename)
bytes, err := ioutil.ReadFile(path)
bytes, err := os.ReadFile(path)
if err != nil {
t.Fatalf("Couldn't load test data example PullREquest event data: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions test/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package test
import (
"context"
"fmt"
"io/ioutil"
"io"
"strings"

corev1 "k8s.io/api/core/v1"
Expand All @@ -40,7 +40,7 @@ func CollectPodLogsWithLabel(c kubernetes.Interface, namespace, labelSelector st
if err != nil {
return "", err
}
bs, err := ioutil.ReadAll(rc)
bs, err := io.ReadAll(rc)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 4bb9457

Please sign in to comment.