cli/command/stack: remove uses of pkg/errors in tests
While there may be reasons to keep pkg/errors in production code, we don't need them for these tests. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -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",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user