cli/command/checkpoint: 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:
Sebastiaan van Stijn 2025-02-01 14:38:31 +01:00
parent 10aca7dd50
commit 957be84a3c
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
3 changed files with 6 additions and 6 deletions

View File

@ -1,13 +1,13 @@
package checkpoint
import (
"errors"
"io"
"strings"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types/checkpoint"
"github.com/pkg/errors"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
@ -29,7 +29,7 @@ func TestCheckpointCreateErrors(t *testing.T) {
{
args: []string{"foo", "bar"},
checkpointCreateFunc: func(container string, options checkpoint.CreateOptions) error {
return errors.Errorf("error creating checkpoint for container foo")
return errors.New("error creating checkpoint for container foo")
},
expectedError: "error creating checkpoint for container foo",
},

View File

@ -1,12 +1,12 @@
package checkpoint
import (
"errors"
"io"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types/checkpoint"
"github.com/pkg/errors"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/golden"
@ -29,7 +29,7 @@ func TestCheckpointListErrors(t *testing.T) {
{
args: []string{"foo"},
checkpointListFunc: func(container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error) {
return []checkpoint.Summary{}, errors.Errorf("error getting checkpoints for container foo")
return []checkpoint.Summary{}, errors.New("error getting checkpoints for container foo")
},
expectedError: "error getting checkpoints for container foo",
},

View File

@ -1,12 +1,12 @@
package checkpoint
import (
"errors"
"io"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types/checkpoint"
"github.com/pkg/errors"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
@ -28,7 +28,7 @@ func TestCheckpointRemoveErrors(t *testing.T) {
{
args: []string{"foo", "bar"},
checkpointDeleteFunc: func(container string, options checkpoint.DeleteOptions) error {
return errors.Errorf("error deleting checkpoint")
return errors.New("error deleting checkpoint")
},
expectedError: "error deleting checkpoint",
},