diff --git a/cli/command/stack/list_test.go b/cli/command/stack/list_test.go index dd4bd4940a..92afa22f69 100644 --- a/cli/command/stack/list_test.go +++ b/cli/command/stack/list_test.go @@ -1,6 +1,7 @@ package stack import ( + "errors" "io" "testing" @@ -8,7 +9,6 @@ import ( "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/pkg/errors" "gotest.tools/v3/assert" "gotest.tools/v3/golden" ) @@ -34,7 +34,7 @@ func TestListErrors(t *testing.T) { { args: []string{}, serviceListFunc: func(options types.ServiceListOptions) ([]swarm.Service, error) { - return []swarm.Service{}, errors.Errorf("error getting services") + return []swarm.Service{}, errors.New("error getting services") }, expectedError: "error getting services", }, diff --git a/cli/command/stack/ps_test.go b/cli/command/stack/ps_test.go index 321425139c..117bdeaf8c 100644 --- a/cli/command/stack/ps_test.go +++ b/cli/command/stack/ps_test.go @@ -1,6 +1,7 @@ package stack import ( + "errors" "io" "testing" "time" @@ -10,7 +11,6 @@ import ( "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -33,7 +33,7 @@ func TestStackPsErrors(t *testing.T) { { args: []string{"foo"}, taskListFunc: func(options types.TaskListOptions) ([]swarm.Task, error) { - return nil, errors.Errorf("error getting tasks") + return nil, errors.New("error getting tasks") }, expectedError: "error getting tasks", }, diff --git a/cli/command/stack/services_test.go b/cli/command/stack/services_test.go index 29f9558654..ca71ab9779 100644 --- a/cli/command/stack/services_test.go +++ b/cli/command/stack/services_test.go @@ -1,6 +1,7 @@ package stack import ( + "errors" "io" "testing" @@ -9,7 +10,6 @@ import ( "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -27,7 +27,7 @@ func TestStackServicesErrors(t *testing.T) { { args: []string{"foo"}, serviceListFunc: func(options types.ServiceListOptions) ([]swarm.Service, error) { - return nil, errors.Errorf("error getting services") + return nil, errors.New("error getting services") }, expectedError: "error getting services", }, @@ -37,7 +37,7 @@ func TestStackServicesErrors(t *testing.T) { return []swarm.Service{*builders.Service(builders.GlobalService())}, nil }, nodeListFunc: func(options types.NodeListOptions) ([]swarm.Node, error) { - return nil, errors.Errorf("error getting nodes") + return nil, errors.New("error getting nodes") }, taskListFunc: func(options types.TaskListOptions) ([]swarm.Task, error) { return []swarm.Task{*builders.Task()}, nil @@ -50,7 +50,7 @@ func TestStackServicesErrors(t *testing.T) { return []swarm.Service{*builders.Service(builders.GlobalService())}, nil }, taskListFunc: func(options types.TaskListOptions) ([]swarm.Task, error) { - return nil, errors.Errorf("error getting tasks") + return nil, errors.New("error getting tasks") }, expectedError: "error getting tasks", }, diff --git a/cli/command/stack/swarm/deploy_composefile_test.go b/cli/command/stack/swarm/deploy_composefile_test.go index 0cb66e8b44..0df678a84f 100644 --- a/cli/command/stack/swarm/deploy_composefile_test.go +++ b/cli/command/stack/swarm/deploy_composefile_test.go @@ -2,11 +2,11 @@ package swarm import ( "context" + "errors" "testing" "github.com/docker/cli/internal/test/network" networktypes "github.com/docker/docker/api/types/network" - "github.com/pkg/errors" "gotest.tools/v3/assert" ) @@ -28,8 +28,8 @@ func TestValidateExternalNetworks(t *testing.T) { expectedMsg: "could not be found. You need to create a swarm-scoped network", }, { - inspectError: errors.New("Unexpected"), - expectedMsg: "Unexpected", + inspectError: errors.New("unexpected"), + expectedMsg: "unexpected", }, // FIXME(vdemeester) that doesn't work under windows, the check needs to be smarter /* @@ -49,13 +49,13 @@ func TestValidateExternalNetworks(t *testing.T) { } for _, testcase := range testcases { - fakeClient := &network.FakeClient{ + client := &network.FakeClient{ NetworkInspectFunc: func(_ context.Context, _ string, _ networktypes.InspectOptions) (networktypes.Inspect, error) { return testcase.inspectResponse, testcase.inspectError }, } networks := []string{testcase.network} - err := validateExternalNetworks(context.Background(), fakeClient, networks) + err := validateExternalNetworks(context.Background(), client, networks) if testcase.expectedMsg == "" { assert.NilError(t, err) } else {