cli/command/swarm: fakeClient: remove name for unused arg (revive)

cli/command/swarm/ipnet_slice_test.go:13:14: unused-parameter: parameter 'ip' seems to be unused, consider removing or renaming it as _ (revive)
    func getCIDR(ip net.IP, cidr *net.IPNet, err error) net.IPNet {
                 ^
    cli/command/swarm/client_test.go:24:29: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) Info(ctx context.Context) (types.Info, error) {
                                ^
    cli/command/swarm/client_test.go:31:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) {
                                              ^
    cli/command/swarm/client_test.go:38:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) {
                                     ^
    cli/command/swarm/client_test.go:45:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmInspect(ctx context.Context) (swarm.Swarm, error) {
                                        ^
    cli/command/swarm/client_test.go:52:42: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) {
                                             ^
    cli/command/swarm/client_test.go:59:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error {
                                     ^
    cli/command/swarm/client_test.go:66:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmLeave(ctx context.Context, force bool) error {
                                      ^
    cli/command/swarm/client_test.go:73:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error {
                                       ^
    cli/command/swarm/client_test.go:80:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error {
                                       ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-03-30 16:38:10 +02:00
parent b0d0b0efcb
commit 40a51d5543
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 10 additions and 10 deletions

View File

@ -21,63 +21,63 @@ type fakeClient struct {
swarmUnlockFunc func(req swarm.UnlockRequest) error swarmUnlockFunc func(req swarm.UnlockRequest) error
} }
func (cli *fakeClient) Info(ctx context.Context) (types.Info, error) { func (cli *fakeClient) Info(context.Context) (types.Info, error) {
if cli.infoFunc != nil { if cli.infoFunc != nil {
return cli.infoFunc() return cli.infoFunc()
} }
return types.Info{}, nil return types.Info{}, nil
} }
func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) { func (cli *fakeClient) NodeInspectWithRaw(context.Context, string) (swarm.Node, []byte, error) {
if cli.nodeInspectFunc != nil { if cli.nodeInspectFunc != nil {
return cli.nodeInspectFunc() return cli.nodeInspectFunc()
} }
return swarm.Node{}, []byte{}, nil return swarm.Node{}, []byte{}, nil
} }
func (cli *fakeClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { func (cli *fakeClient) SwarmInit(context.Context, swarm.InitRequest) (string, error) {
if cli.swarmInitFunc != nil { if cli.swarmInitFunc != nil {
return cli.swarmInitFunc() return cli.swarmInitFunc()
} }
return "", nil return "", nil
} }
func (cli *fakeClient) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { func (cli *fakeClient) SwarmInspect(context.Context) (swarm.Swarm, error) {
if cli.swarmInspectFunc != nil { if cli.swarmInspectFunc != nil {
return cli.swarmInspectFunc() return cli.swarmInspectFunc()
} }
return swarm.Swarm{}, nil return swarm.Swarm{}, nil
} }
func (cli *fakeClient) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) { func (cli *fakeClient) SwarmGetUnlockKey(context.Context) (types.SwarmUnlockKeyResponse, error) {
if cli.swarmGetUnlockKeyFunc != nil { if cli.swarmGetUnlockKeyFunc != nil {
return cli.swarmGetUnlockKeyFunc() return cli.swarmGetUnlockKeyFunc()
} }
return types.SwarmUnlockKeyResponse{}, nil return types.SwarmUnlockKeyResponse{}, nil
} }
func (cli *fakeClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { func (cli *fakeClient) SwarmJoin(context.Context, swarm.JoinRequest) error {
if cli.swarmJoinFunc != nil { if cli.swarmJoinFunc != nil {
return cli.swarmJoinFunc() return cli.swarmJoinFunc()
} }
return nil return nil
} }
func (cli *fakeClient) SwarmLeave(ctx context.Context, force bool) error { func (cli *fakeClient) SwarmLeave(context.Context, bool) error {
if cli.swarmLeaveFunc != nil { if cli.swarmLeaveFunc != nil {
return cli.swarmLeaveFunc() return cli.swarmLeaveFunc()
} }
return nil return nil
} }
func (cli *fakeClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { func (cli *fakeClient) SwarmUpdate(_ context.Context, _ swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error {
if cli.swarmUpdateFunc != nil { if cli.swarmUpdateFunc != nil {
return cli.swarmUpdateFunc(swarm, flags) return cli.swarmUpdateFunc(swarm, flags)
} }
return nil return nil
} }
func (cli *fakeClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { func (cli *fakeClient) SwarmUnlock(_ context.Context, req swarm.UnlockRequest) error {
if cli.swarmUnlockFunc != nil { if cli.swarmUnlockFunc != nil {
return cli.swarmUnlockFunc(req) return cli.swarmUnlockFunc(req)
} }

View File

@ -10,7 +10,7 @@ import (
) )
// Helper function to set static slices // Helper function to set static slices
func getCIDR(ip net.IP, cidr *net.IPNet, err error) net.IPNet { func getCIDR(_ net.IP, cidr *net.IPNet, _ error) net.IPNet {
return *cidr return *cidr
} }