replace deprecated io/ioutil

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2022-11-02 22:55:22 +01:00
parent e3509fc1de
commit f8b3af78fc
33 changed files with 113 additions and 202 deletions

View File

@@ -13,7 +13,7 @@ import (
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"io/ioutil"
"io"
"math/big"
"net"
"net/http"
@@ -121,7 +121,7 @@ func TestGracefulShutdown(t *testing.T) {
if resp.Status != "200 OK" {
t.Error("response status is not 200 OK: ", resp.Status)
}
if body, err := ioutil.ReadAll(resp.Body); err != nil || string(body) != "{}" {
if body, err := io.ReadAll(resp.Body); err != nil || string(body) != "{}" {
t.Error("Body is not {}; ", string(body))
}
}
@@ -316,7 +316,7 @@ func TestRegistrySupportedCipherSuite(t *testing.T) {
if resp.Status != "200 OK" {
t.Error("response status is not 200 OK: ", resp.Status)
}
if body, err := ioutil.ReadAll(resp.Body); err != nil || string(body) != "{}" {
if body, err := io.ReadAll(resp.Body); err != nil || string(body) != "{}" {
t.Error("Body is not {}; ", string(body))
}