From 537b88dab952c88bab6df14a4d27427bcf6c2c7e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 10 May 2023 22:37:32 +0200 Subject: [PATCH] cli/command: don't use legacy "notfound" error-type in tests Signed-off-by: Sebastiaan van Stijn --- cli/command/container/create_test.go | 4 ++-- cli/command/image/remove_test.go | 4 +--- cli/command/stack/swarm/deploy_composefile_test.go | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cli/command/container/create_test.go b/cli/command/container/create_test.go index c74b5d359e..725b6c9326 100644 --- a/cli/command/container/create_test.go +++ b/cli/command/container/create_test.go @@ -350,5 +350,5 @@ func TestCreateContainerWithProxyConfig(t *testing.T) { type fakeNotFound struct{} -func (f fakeNotFound) NotFound() bool { return true } -func (f fakeNotFound) Error() string { return "error fake not found" } +func (f fakeNotFound) NotFound() {} +func (f fakeNotFound) Error() string { return "error fake not found" } diff --git a/cli/command/image/remove_test.go b/cli/command/image/remove_test.go index 55de3eb6a6..00a8c61047 100644 --- a/cli/command/image/remove_test.go +++ b/cli/command/image/remove_test.go @@ -21,9 +21,7 @@ func (n notFound) Error() string { return fmt.Sprintf("Error: No such image: %s", n.imageID) } -func (n notFound) NotFound() bool { - return true -} +func (n notFound) NotFound() {} func TestNewRemoveCommandAlias(t *testing.T) { cmd := newRemoveCommand(test.NewFakeCli(&fakeClient{})) diff --git a/cli/command/stack/swarm/deploy_composefile_test.go b/cli/command/stack/swarm/deploy_composefile_test.go index 86a5e09abd..6e4913be08 100644 --- a/cli/command/stack/swarm/deploy_composefile_test.go +++ b/cli/command/stack/swarm/deploy_composefile_test.go @@ -14,9 +14,7 @@ type notFound struct { error } -func (n notFound) NotFound() bool { - return true -} +func (n notFound) NotFound() {} func TestValidateExternalNetworks(t *testing.T) { testcases := []struct {