From 957be84a3c7be87bbfedbaa132e81df738b61adc Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 1 Feb 2025 14:38:31 +0100 Subject: [PATCH] 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 --- cli/command/checkpoint/create_test.go | 4 ++-- cli/command/checkpoint/list_test.go | 4 ++-- cli/command/checkpoint/remove_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/command/checkpoint/create_test.go b/cli/command/checkpoint/create_test.go index b3b7372080..6015dc03dd 100644 --- a/cli/command/checkpoint/create_test.go +++ b/cli/command/checkpoint/create_test.go @@ -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", }, diff --git a/cli/command/checkpoint/list_test.go b/cli/command/checkpoint/list_test.go index 437cc1b359..33d2e6379c 100644 --- a/cli/command/checkpoint/list_test.go +++ b/cli/command/checkpoint/list_test.go @@ -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", }, diff --git a/cli/command/checkpoint/remove_test.go b/cli/command/checkpoint/remove_test.go index ae8402edb2..7064fbf1ee 100644 --- a/cli/command/checkpoint/remove_test.go +++ b/cli/command/checkpoint/remove_test.go @@ -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", },