mirror of https://github.com/docker/cli.git
cli/command/service: remove deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c558df7ced
commit
d1f26de646
|
@ -3,7 +3,6 @@ package service
|
|||
import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/docker/cli/cli/command/service/progress"
|
||||
|
@ -21,7 +20,7 @@ func waitOnService(ctx context.Context, dockerCli command.Cli, serviceID string,
|
|||
}()
|
||||
|
||||
if quiet {
|
||||
go io.Copy(ioutil.Discard, pipeReader)
|
||||
go io.Copy(io.Discard, pipeReader)
|
||||
return <-errChan
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package service
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -49,7 +49,7 @@ func TestRollback(t *testing.T) {
|
|||
cmd := newRollbackCommand(cli)
|
||||
cmd.SetArgs(tc.args)
|
||||
cmd.Flags().Set("quiet", "true")
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetOut(io.Discard)
|
||||
assert.NilError(t, cmd.Execute())
|
||||
assert.Check(t, is.Equal(strings.TrimSpace(cli.ErrBuffer().String()), tc.expectedDockerCliErr))
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ func TestRollbackWithErrors(t *testing.T) {
|
|||
}))
|
||||
cmd.SetArgs(tc.args)
|
||||
cmd.Flags().Set("quiet", "true")
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetOut(io.Discard)
|
||||
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue