Remove deprecated io/ioutil (#15707)

This commit is contained in:
Klaus Post
2022-09-19 20:05:16 +02:00
committed by GitHub
parent 0b6175b742
commit ff12080ff5
89 changed files with 315 additions and 370 deletions

View File

@@ -21,7 +21,6 @@ import (
"bytes"
"encoding/hex"
"io"
"io/ioutil"
"testing"
"github.com/minio/minio/internal/kms"
@@ -64,7 +63,7 @@ func TestEncryptDecrypt(t *testing.T) {
if err != nil {
t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
}
data, err := ioutil.ReadAll(ciphertext)
data, err := io.ReadAll(ciphertext)
if err != nil {
t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
}
@@ -73,7 +72,7 @@ func TestEncryptDecrypt(t *testing.T) {
if err != nil {
t.Fatalf("Test %d: failed to decrypt stream: %v", i, err)
}
data, err = ioutil.ReadAll(plaintext)
data, err = io.ReadAll(plaintext)
if err != nil {
t.Fatalf("Test %d: failed to decrypt stream: %v", i, err)
}
@@ -106,7 +105,7 @@ func BenchmarkEncrypt(b *testing.B) {
if err != nil {
b.Fatal(err)
}
if _, err = io.Copy(ioutil.Discard, ciphertext); err != nil {
if _, err = io.Copy(io.Discard, ciphertext); err != nil {
b.Fatal(err)
}
plaintext.Reset(data)