cli/command/image: 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:41:04 +01:00
parent d30c894af1
commit f29fdd3091
8 changed files with 17 additions and 17 deletions

View File

@ -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")
},
},
}