diff --git a/cli/command/image/history_test.go b/cli/command/image/history_test.go index 4a406864d5..1aa91c963a 100644 --- a/cli/command/image/history_test.go +++ b/cli/command/image/history_test.go @@ -1,6 +1,7 @@ package image import ( + "errors" "fmt" "io" "testing" @@ -9,7 +10,6 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -32,7 +32,7 @@ func TestNewHistoryCommandErrors(t *testing.T) { args: []string{"image:tag"}, expectedError: "something went wrong", imageHistoryFunc: func(img string, options image.HistoryOptions) ([]image.HistoryResponseItem, error) { - return []image.HistoryResponseItem{{}}, errors.Errorf("something went wrong") + return []image.HistoryResponseItem{{}}, errors.New("something went wrong") }, }, { diff --git a/cli/command/image/import_test.go b/cli/command/image/import_test.go index f61a80b9d3..d6d69948df 100644 --- a/cli/command/image/import_test.go +++ b/cli/command/image/import_test.go @@ -1,13 +1,13 @@ package image import ( + "errors" "io" "strings" "testing" "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -29,7 +29,7 @@ func TestNewImportCommandErrors(t *testing.T) { args: []string{"testdata/import-command-success.input.txt"}, expectedError: "something went wrong", imageImportFunc: func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { - return nil, errors.Errorf("something went wrong") + return nil, errors.New("something went wrong") }, }, } diff --git a/cli/command/image/list_test.go b/cli/command/image/list_test.go index 3129fe12ac..8b3ff715be 100644 --- a/cli/command/image/list_test.go +++ b/cli/command/image/list_test.go @@ -1,6 +1,7 @@ package image import ( + "errors" "fmt" "io" "testing" @@ -8,7 +9,6 @@ import ( "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -30,7 +30,7 @@ func TestNewImagesCommandErrors(t *testing.T) { name: "failed-list", expectedError: "something went wrong", imageListFunc: func(options image.ListOptions) ([]image.Summary, error) { - return []image.Summary{}, errors.Errorf("something went wrong") + return []image.Summary{}, errors.New("something went wrong") }, }, } diff --git a/cli/command/image/load_test.go b/cli/command/image/load_test.go index 87f91c6db3..f15c295efd 100644 --- a/cli/command/image/load_test.go +++ b/cli/command/image/load_test.go @@ -1,6 +1,7 @@ package image import ( + "errors" "fmt" "io" "strings" @@ -9,7 +10,6 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -39,7 +39,7 @@ func TestNewLoadCommandErrors(t *testing.T) { args: []string{}, expectedError: "something went wrong", imageLoadFunc: func(input io.Reader, options image.LoadOptions) (image.LoadResponse, error) { - return image.LoadResponse{}, errors.Errorf("something went wrong") + return image.LoadResponse{}, errors.New("something went wrong") }, }, { diff --git a/cli/command/image/prune_test.go b/cli/command/image/prune_test.go index 8e8d3540a6..87c8d0da12 100644 --- a/cli/command/image/prune_test.go +++ b/cli/command/image/prune_test.go @@ -2,6 +2,7 @@ package image import ( "context" + "errors" "fmt" "io" "strings" @@ -11,7 +12,6 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/image" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -34,7 +34,7 @@ func TestNewPruneCommandErrors(t *testing.T) { args: []string{"--force"}, expectedError: "something went wrong", imagesPruneFunc: func(pruneFilter filters.Args) (image.PruneReport, error) { - return image.PruneReport{}, errors.Errorf("something went wrong") + return image.PruneReport{}, errors.New("something went wrong") }, }, } diff --git a/cli/command/image/push_test.go b/cli/command/image/push_test.go index 132b0e9a5d..88415ea8e0 100644 --- a/cli/command/image/push_test.go +++ b/cli/command/image/push_test.go @@ -1,13 +1,13 @@ package image import ( + "errors" "io" "strings" "testing" "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" - "github.com/pkg/errors" "gotest.tools/v3/assert" ) @@ -33,7 +33,7 @@ func TestNewPushCommandErrors(t *testing.T) { args: []string{"image:repo"}, expectedError: "Failed to push", imagePushFunc: func(ref string, options image.PushOptions) (io.ReadCloser, error) { - return io.NopCloser(strings.NewReader("")), errors.Errorf("Failed to push") + return io.NopCloser(strings.NewReader("")), errors.New("Failed to push") }, }, } diff --git a/cli/command/image/remove_test.go b/cli/command/image/remove_test.go index 61a7a346f5..dc9af57f38 100644 --- a/cli/command/image/remove_test.go +++ b/cli/command/image/remove_test.go @@ -1,13 +1,13 @@ package image import ( + "errors" "fmt" "io" "testing" "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -47,7 +47,7 @@ func TestNewRemoveCommandErrors(t *testing.T) { expectedError: "error removing image", imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { assert.Check(t, is.Equal("image1", img)) - return []image.DeleteResponse{}, errors.Errorf("error removing image") + return []image.DeleteResponse{}, errors.New("error removing image") }, }, { @@ -57,7 +57,7 @@ func TestNewRemoveCommandErrors(t *testing.T) { imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { assert.Check(t, !options.Force) assert.Check(t, options.PruneChildren) - return []image.DeleteResponse{}, errors.Errorf("error removing image") + return []image.DeleteResponse{}, errors.New("error removing image") }, }, } diff --git a/cli/command/image/save_test.go b/cli/command/image/save_test.go index 34b71924a4..3bd87dbc75 100644 --- a/cli/command/image/save_test.go +++ b/cli/command/image/save_test.go @@ -1,6 +1,7 @@ package image import ( + "errors" "io" "os" "strings" @@ -9,7 +10,6 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -39,7 +39,7 @@ func TestNewSaveCommandErrors(t *testing.T) { isTerminal: false, expectedError: "error saving image", imageSaveFunc: func(images []string, options image.SaveOptions) (io.ReadCloser, error) { - return io.NopCloser(strings.NewReader("")), errors.Errorf("error saving image") + return io.NopCloser(strings.NewReader("")), errors.New("error saving image") }, }, {