Skip to content

Commit 5d92f5b

Browse files
committed
Migrate away from deprecated ioutil
1 parent c052b8a commit 5d92f5b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

test/e2e/metrics_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"crypto/tls"
77
"crypto/x509"
88
"fmt"
9-
"io/ioutil"
9+
"io"
1010
"net/http"
1111
"strings"
1212
"testing"
@@ -104,7 +104,7 @@ func metricsRequest(t *testing.T, routeForMetrics string) string {
104104
}
105105

106106
defer resp.Body.Close()
107-
bytes, err = ioutil.ReadAll(resp.Body)
107+
bytes, err = io.ReadAll(resp.Body)
108108
if err != nil {
109109
t.Logf("error reading metrics response: %s\n", err)
110110
return false, err

tools/import-verifier/import-verifier.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"fmt"
77
"io"
8-
"io/ioutil"
98
"log"
109
"os"
1110
"os/exec"
@@ -303,7 +302,7 @@ func mergePackages(existingPackages, currPackages []Package) []Package {
303302
}
304303

305304
func loadImportRestrictions(configFile string) ([]ImportRestriction, error) {
306-
config, err := ioutil.ReadFile(configFile)
305+
config, err := os.ReadFile(configFile)
307306
if err != nil {
308307
return nil, fmt.Errorf("failed to load configuration from %s: %v", configFile, err)
309308
}

0 commit comments

Comments
 (0)