From 1a4491f8c649534680ec234a5e760e19f4e9ac1e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 17 Feb 2025 14:29:22 +0100 Subject: [PATCH] cli/command/stack: fix "unused-receiver" linting cli/command/stack/swarm/client_test.go:47:7: unused-receiver: method receiver 'cli' is not referenced in method's body, consider removing or renaming it as _ (revive) func (cli *fakeClient) ServerVersion(context.Context) (types.Version, error) { ^ cli/command/stack/swarm/deploy_composefile_test.go:17:7: unused-receiver: method receiver 'n' is not referenced in method's body, consider removing or renaming it as _ (revive) func (n notFound) NotFound() {} ^ cli/command/stack/client_test.go:47:7: unused-receiver: method receiver 'cli' is not referenced in method's body, consider removing or renaming it as _ (revive) func (cli *fakeClient) ServerVersion(context.Context) (types.Version, error) { ^ cli/command/stack/client_test.go:183:7: unused-receiver: method receiver 'cli' is not referenced in method's body, consider removing or renaming it as _ (revive) func (cli *fakeClient) ServiceInspectWithRaw(_ context.Context, serviceID string, _ types.ServiceInspectOptions) (swarm.Service, []byte, error) { ^ Signed-off-by: Sebastiaan van Stijn --- cli/command/stack/client_test.go | 4 ++-- cli/command/stack/swarm/client_test.go | 2 +- cli/command/stack/swarm/deploy_composefile_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/command/stack/client_test.go b/cli/command/stack/client_test.go index 7d9072d2de..ea1ed02a4d 100644 --- a/cli/command/stack/client_test.go +++ b/cli/command/stack/client_test.go @@ -44,7 +44,7 @@ type fakeClient struct { configRemoveFunc func(configID string) error } -func (cli *fakeClient) ServerVersion(context.Context) (types.Version, error) { +func (*fakeClient) ServerVersion(context.Context) (types.Version, error) { return types.Version{ Version: "docker-dev", APIVersion: api.DefaultVersion, @@ -180,7 +180,7 @@ func (cli *fakeClient) ConfigRemove(_ context.Context, configID string) error { return nil } -func (cli *fakeClient) ServiceInspectWithRaw(_ context.Context, serviceID string, _ types.ServiceInspectOptions) (swarm.Service, []byte, error) { +func (*fakeClient) ServiceInspectWithRaw(_ context.Context, serviceID string, _ types.ServiceInspectOptions) (swarm.Service, []byte, error) { return swarm.Service{ ID: serviceID, Spec: swarm.ServiceSpec{ diff --git a/cli/command/stack/swarm/client_test.go b/cli/command/stack/swarm/client_test.go index 78f4997c6a..28f6aac35c 100644 --- a/cli/command/stack/swarm/client_test.go +++ b/cli/command/stack/swarm/client_test.go @@ -44,7 +44,7 @@ type fakeClient struct { configRemoveFunc func(configID string) error } -func (cli *fakeClient) ServerVersion(context.Context) (types.Version, error) { +func (*fakeClient) ServerVersion(context.Context) (types.Version, error) { return types.Version{ Version: "docker-dev", APIVersion: api.DefaultVersion, diff --git a/cli/command/stack/swarm/deploy_composefile_test.go b/cli/command/stack/swarm/deploy_composefile_test.go index 0df678a84f..7df4b4551c 100644 --- a/cli/command/stack/swarm/deploy_composefile_test.go +++ b/cli/command/stack/swarm/deploy_composefile_test.go @@ -14,7 +14,7 @@ type notFound struct { error } -func (n notFound) NotFound() {} +func (notFound) NotFound() {} func TestValidateExternalNetworks(t *testing.T) { testcases := []struct {