mirror of https://github.com/docker/cli.git
cmd/docker: remove deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0e3197ebd4
)
Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
parent
a0f0a4fe7a
commit
f471347d88
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ func TestClientDebugEnabled(t *testing.T) {
|
||||||
assert.Check(t, is.Equal(logrus.DebugLevel, logrus.GetLevel()))
|
assert.Check(t, is.Equal(logrus.DebugLevel, logrus.GetLevel()))
|
||||||
}
|
}
|
||||||
|
|
||||||
var discard = ioutil.NopCloser(bytes.NewBuffer(nil))
|
var discard = io.NopCloser(bytes.NewBuffer(nil))
|
||||||
|
|
||||||
func runCliCommand(t *testing.T, r io.ReadCloser, w io.Writer, args ...string) error {
|
func runCliCommand(t *testing.T, r io.ReadCloser, w io.Writer, args ...string) error {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
@ -38,7 +37,7 @@ func runCliCommand(t *testing.T, r io.ReadCloser, w io.Writer, args ...string) e
|
||||||
r = discard
|
r = discard
|
||||||
}
|
}
|
||||||
if w == nil {
|
if w == nil {
|
||||||
w = ioutil.Discard
|
w = io.Discard
|
||||||
}
|
}
|
||||||
cli, err := command.NewDockerCli(command.WithInputStream(r), command.WithCombinedStreams(w))
|
cli, err := command.NewDockerCli(command.WithInputStream(r), command.WithCombinedStreams(w))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
Loading…
Reference in New Issue