mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
fix: remove deprecated io/ioutils package (#2120)
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 #2119
This commit is contained in:
parent
1f80fa2e23
commit
bd914e58d6
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue