Skip to content

Commit cca73bf

Browse files
committed
cli/command/volume: remove deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent b5dce3c commit cca73bf

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

cli/command/volume/create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package volume
22

33
import (
4-
"io/ioutil"
4+
"io"
55
"reflect"
66
"strings"
77
"testing"
@@ -49,7 +49,7 @@ func TestVolumeCreateErrors(t *testing.T) {
4949
for key, value := range tc.flags {
5050
cmd.Flags().Set(key, value)
5151
}
52-
cmd.SetOut(ioutil.Discard)
52+
cmd.SetOut(io.Discard)
5353
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
5454
}
5555
}

cli/command/volume/inspect_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package volume
22

33
import (
44
"fmt"
5-
"io/ioutil"
5+
"io"
66
"testing"
77

88
"github.com/docker/cli/internal/test"
@@ -60,7 +60,7 @@ func TestVolumeInspectErrors(t *testing.T) {
6060
for key, value := range tc.flags {
6161
cmd.Flags().Set(key, value)
6262
}
63-
cmd.SetOut(ioutil.Discard)
63+
cmd.SetOut(io.Discard)
6464
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
6565
}
6666
}

cli/command/volume/list_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package volume
22

33
import (
4-
"io/ioutil"
4+
"io"
55
"testing"
66

77
"github.com/docker/cli/cli/config/configfile"
@@ -43,7 +43,7 @@ func TestVolumeListErrors(t *testing.T) {
4343
for key, value := range tc.flags {
4444
cmd.Flags().Set(key, value)
4545
}
46-
cmd.SetOut(ioutil.Discard)
46+
cmd.SetOut(io.Discard)
4747
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
4848
}
4949
}

cli/command/volume/prune_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package volume
22

33
import (
44
"fmt"
5-
"io/ioutil"
5+
"io"
66
"runtime"
77
"strings"
88
"testing"
@@ -48,7 +48,7 @@ func TestVolumePruneErrors(t *testing.T) {
4848
for key, value := range tc.flags {
4949
cmd.Flags().Set(key, value)
5050
}
51-
cmd.SetOut(ioutil.Discard)
51+
cmd.SetOut(io.Discard)
5252
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
5353
}
5454
}
@@ -86,7 +86,7 @@ func TestVolumePrunePromptYes(t *testing.T) {
8686
volumePruneFunc: simplePruneFunc,
8787
})
8888

89-
cli.SetIn(streams.NewIn(ioutil.NopCloser(strings.NewReader(input))))
89+
cli.SetIn(streams.NewIn(io.NopCloser(strings.NewReader(input))))
9090
cmd := NewPruneCommand(cli)
9191
assert.NilError(t, cmd.Execute())
9292
golden.Assert(t, cli.OutBuffer().String(), "volume-prune-yes.golden")
@@ -102,7 +102,7 @@ func TestVolumePrunePromptNo(t *testing.T) {
102102
volumePruneFunc: simplePruneFunc,
103103
})
104104

105-
cli.SetIn(streams.NewIn(ioutil.NopCloser(strings.NewReader(input))))
105+
cli.SetIn(streams.NewIn(io.NopCloser(strings.NewReader(input))))
106106
cmd := NewPruneCommand(cli)
107107
assert.NilError(t, cmd.Execute())
108108
golden.Assert(t, cli.OutBuffer().String(), "volume-prune-no.golden")

cli/command/volume/remove_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package volume
22

33
import (
4-
"io/ioutil"
4+
"io"
55
"testing"
66

77
"github.com/docker/cli/internal/test"
@@ -32,7 +32,7 @@ func TestVolumeRemoveErrors(t *testing.T) {
3232
volumeRemoveFunc: tc.volumeRemoveFunc,
3333
}))
3434
cmd.SetArgs(tc.args)
35-
cmd.SetOut(ioutil.Discard)
35+
cmd.SetOut(io.Discard)
3636
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
3737
}
3838
}

0 commit comments

Comments
 (0)