all: Remove usage of deprecated io/ioutil (#7971)
As of Go 1.16 io/ioutil is deprecated. This replaces usage with the corresponding functions in package os and package io.
This commit is contained in:
+5
-4
@@ -11,8 +11,9 @@ package integration
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -33,7 +34,7 @@ func TestHTTPGetIndex(t *testing.T) {
|
||||
if res.StatusCode != 200 {
|
||||
t.Errorf("Status %d != 200", res.StatusCode)
|
||||
}
|
||||
bs, err := ioutil.ReadAll(res.Body)
|
||||
bs, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -57,7 +58,7 @@ func TestHTTPGetIndex(t *testing.T) {
|
||||
if res.StatusCode != 200 {
|
||||
t.Errorf("Status %d != 200", res.StatusCode)
|
||||
}
|
||||
bs, err = ioutil.ReadAll(res.Body)
|
||||
bs, err = io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -222,7 +223,7 @@ func setupAPIBench() *rc.Process {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile("s1/knownfile", []byte("somedatahere"), 0644)
|
||||
err = os.WriteFile("s1/knownfile", []byte("somedatahere"), 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user