1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-04-11 01:07:18 +00:00

fix: remove deprecated io/ioutils package

ioutils.ReadAll is deprecated since Go 1.16. This commit replaces it with
io.ReadAll. See https://pkg.go.dev/io/ioutil\#ReadAll for reference

Issue 
This commit is contained in:
pedromotita 2024-03-08 11:11:46 -03:00
parent 4fb0a66a34
commit 2485f00b27

View file

@ -18,7 +18,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"os"
"reflect"
"strings"
@ -2092,12 +2092,12 @@ func TestCommandPrintRedirection(t *testing.T) {
t.Error(err)
}
gotErrBytes, err := ioutil.ReadAll(errBuff)
gotErrBytes, err := io.ReadAll(errBuff)
if err != nil {
t.Error(err)
}
gotOutBytes, err := ioutil.ReadAll(outBuff)
gotOutBytes, err := io.ReadAll(outBuff)
if err != nil {
t.Error(err)
}