From 22300128caaee3b4524323dc4121bbc2fd18a725 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 25 Feb 2022 13:20:55 +0100 Subject: [PATCH] cli/command/node: remove deprecated io/ioutil Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 9bdeb09ae92e8bf40c7ca5ff00fb28484f5da1b2) Signed-off-by: Cory Snider --- cli/command/node/demote_test.go | 4 ++-- cli/command/node/inspect_test.go | 4 ++-- cli/command/node/list_test.go | 4 ++-- cli/command/node/promote_test.go | 4 ++-- cli/command/node/ps_test.go | 4 ++-- cli/command/node/remove_test.go | 4 ++-- cli/command/node/update_test.go | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cli/command/node/demote_test.go b/cli/command/node/demote_test.go index c4d6c26769..8c226a9f9f 100644 --- a/cli/command/node/demote_test.go +++ b/cli/command/node/demote_test.go @@ -1,7 +1,7 @@ package node import ( - "io/ioutil" + "io" "testing" "github.com/docker/cli/internal/test" @@ -43,7 +43,7 @@ func TestNodeDemoteErrors(t *testing.T) { nodeUpdateFunc: tc.nodeUpdateFunc, })) cmd.SetArgs(tc.args) - cmd.SetOut(ioutil.Discard) + cmd.SetOut(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/node/inspect_test.go b/cli/command/node/inspect_test.go index 975db14b7c..2c2e33bedf 100644 --- a/cli/command/node/inspect_test.go +++ b/cli/command/node/inspect_test.go @@ -2,7 +2,7 @@ package node import ( "fmt" - "io/ioutil" + "io" "testing" "github.com/docker/cli/internal/test" @@ -73,7 +73,7 @@ func TestNodeInspectErrors(t *testing.T) { for key, value := range tc.flags { cmd.Flags().Set(key, value) } - cmd.SetOut(ioutil.Discard) + cmd.SetOut(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/node/list_test.go b/cli/command/node/list_test.go index 309bd3798a..6c176795fc 100644 --- a/cli/command/node/list_test.go +++ b/cli/command/node/list_test.go @@ -1,7 +1,7 @@ package node import ( - "io/ioutil" + "io" "testing" "github.com/docker/cli/cli/config/configfile" @@ -47,7 +47,7 @@ func TestNodeListErrorOnAPIFailure(t *testing.T) { infoFunc: tc.infoFunc, }) cmd := newListCommand(cli) - cmd.SetOut(ioutil.Discard) + cmd.SetOut(io.Discard) assert.Error(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/node/promote_test.go b/cli/command/node/promote_test.go index 68299d2983..ebb2890ec2 100644 --- a/cli/command/node/promote_test.go +++ b/cli/command/node/promote_test.go @@ -1,7 +1,7 @@ package node import ( - "io/ioutil" + "io" "testing" "github.com/docker/cli/internal/test" @@ -43,7 +43,7 @@ func TestNodePromoteErrors(t *testing.T) { nodeUpdateFunc: tc.nodeUpdateFunc, })) cmd.SetArgs(tc.args) - cmd.SetOut(ioutil.Discard) + cmd.SetOut(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/node/ps_test.go b/cli/command/node/ps_test.go index 2b6ab9a7a1..870e8eb187 100644 --- a/cli/command/node/ps_test.go +++ b/cli/command/node/ps_test.go @@ -3,7 +3,7 @@ package node import ( "context" "fmt" - "io/ioutil" + "io" "testing" "time" @@ -59,7 +59,7 @@ func TestNodePsErrors(t *testing.T) { for key, value := range tc.flags { cmd.Flags().Set(key, value) } - cmd.SetOut(ioutil.Discard) + cmd.SetOut(io.Discard) assert.Error(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/node/remove_test.go b/cli/command/node/remove_test.go index e4eaf9df71..db7bbcc7de 100644 --- a/cli/command/node/remove_test.go +++ b/cli/command/node/remove_test.go @@ -1,7 +1,7 @@ package node import ( - "io/ioutil" + "io" "testing" "github.com/docker/cli/internal/test" @@ -32,7 +32,7 @@ func TestNodeRemoveErrors(t *testing.T) { nodeRemoveFunc: tc.nodeRemoveFunc, })) cmd.SetArgs(tc.args) - cmd.SetOut(ioutil.Discard) + cmd.SetOut(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/node/update_test.go b/cli/command/node/update_test.go index 879855bfab..797f79f621 100644 --- a/cli/command/node/update_test.go +++ b/cli/command/node/update_test.go @@ -1,7 +1,7 @@ package node import ( - "io/ioutil" + "io" "testing" "github.com/docker/cli/internal/test" @@ -63,7 +63,7 @@ func TestNodeUpdateErrors(t *testing.T) { for key, value := range tc.flags { cmd.Flags().Set(key, value) } - cmd.SetOut(ioutil.Discard) + cmd.SetOut(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } }