diff --git a/cli/command/service/create_test.go b/cli/command/service/create_test.go index e37af4bbf6..169a9e2fed 100644 --- a/cli/command/service/create_test.go +++ b/cli/command/service/create_test.go @@ -21,19 +21,19 @@ func (f fakeConfigAPIClientList) ConfigList(ctx context.Context, opts types.Conf return f(ctx, opts) } -func (f fakeConfigAPIClientList) ConfigCreate(_ context.Context, _ swarm.ConfigSpec) (types.ConfigCreateResponse, error) { +func (fakeConfigAPIClientList) ConfigCreate(_ context.Context, _ swarm.ConfigSpec) (types.ConfigCreateResponse, error) { return types.ConfigCreateResponse{}, nil } -func (f fakeConfigAPIClientList) ConfigRemove(_ context.Context, _ string) error { +func (fakeConfigAPIClientList) ConfigRemove(_ context.Context, _ string) error { return nil } -func (f fakeConfigAPIClientList) ConfigInspectWithRaw(_ context.Context, _ string) (swarm.Config, []byte, error) { +func (fakeConfigAPIClientList) ConfigInspectWithRaw(_ context.Context, _ string) (swarm.Config, []byte, error) { return swarm.Config{}, nil, nil } -func (f fakeConfigAPIClientList) ConfigUpdate(_ context.Context, _ string, _ swarm.Version, _ swarm.ConfigSpec) error { +func (fakeConfigAPIClientList) ConfigUpdate(_ context.Context, _ string, _ swarm.Version, _ swarm.ConfigSpec) error { return nil } diff --git a/cli/command/service/generic_resource_opts.go b/cli/command/service/generic_resource_opts.go index 613c255749..ba5cf6aa5b 100644 --- a/cli/command/service/generic_resource_opts.go +++ b/cli/command/service/generic_resource_opts.go @@ -43,7 +43,9 @@ func ParseGenericResources(value []string) ([]swarm.GenericResource, error) { swarmResources := genericResourcesFromGRPC(resources) for _, res := range swarmResources { if res.NamedResourceSpec != nil { - return nil, fmt.Errorf("invalid generic-resource request `%s=%s`, Named Generic Resources is not supported for service create or update", res.NamedResourceSpec.Kind, res.NamedResourceSpec.Value) + return nil, fmt.Errorf("invalid generic-resource request `%s=%s`, Named Generic Resources is not supported for service create or update", + res.NamedResourceSpec.Kind, res.NamedResourceSpec.Value, + ) } } diff --git a/cli/command/service/logs.go b/cli/command/service/logs.go index b9f964aec9..dd56f828f9 100644 --- a/cli/command/service/logs.go +++ b/cli/command/service/logs.go @@ -265,7 +265,7 @@ func (lw *logWriter) Write(buf []byte) (int, error) { // and then create a context from the details // this removes the context-specific details from the details map, so we // can more easily print the details later - logCtx, err := lw.parseContext(details) + logCtx, err := parseContext(details) if err != nil { return 0, err } @@ -317,7 +317,7 @@ func (lw *logWriter) Write(buf []byte) (int, error) { } // parseContext returns a log context and REMOVES the context from the details map -func (lw *logWriter) parseContext(details map[string]string) (logContext, error) { +func parseContext(details map[string]string) (logContext, error) { nodeID, ok := details["com.docker.swarm.node.id"] if !ok { return logContext{}, errors.Errorf("missing node id in details: %v", details) diff --git a/cli/command/service/opts.go b/cli/command/service/opts.go index 9298cfb131..983e2233be 100644 --- a/cli/command/service/opts.go +++ b/cli/command/service/opts.go @@ -42,7 +42,7 @@ func (i *Uint64Opt) Set(s string) error { } // Type returns the type of this option, which will be displayed in `--help` output -func (i *Uint64Opt) Type() string { +func (*Uint64Opt) Type() string { return "uint" } @@ -67,7 +67,7 @@ func (f *floatValue) Set(s string) error { return err } -func (f *floatValue) Type() string { +func (*floatValue) Type() string { return "float" } @@ -114,7 +114,7 @@ func (o *placementPrefOpts) Set(value string) error { } // Type returns a string name for this Option type -func (o *placementPrefOpts) Type() string { +func (*placementPrefOpts) Type() string { return "pref" } @@ -132,7 +132,7 @@ func (s *ShlexOpt) Set(value string) error { } // Type returns the type of the value -func (s *ShlexOpt) Type() string { +func (*ShlexOpt) Type() string { return "command" } @@ -363,7 +363,7 @@ func (c *credentialSpecOpt) Set(value string) error { return nil } -func (c *credentialSpecOpt) Type() string { +func (*credentialSpecOpt) Type() string { return "credential-spec" } diff --git a/cli/command/service/update_test.go b/cli/command/service/update_test.go index 136f655122..2ace1e2c24 100644 --- a/cli/command/service/update_test.go +++ b/cli/command/service/update_test.go @@ -508,19 +508,19 @@ func (s secretAPIClientMock) SecretList(context.Context, types.SecretListOptions return s.listResult, nil } -func (s secretAPIClientMock) SecretCreate(context.Context, swarm.SecretSpec) (types.SecretCreateResponse, error) { +func (secretAPIClientMock) SecretCreate(context.Context, swarm.SecretSpec) (types.SecretCreateResponse, error) { return types.SecretCreateResponse{}, nil } -func (s secretAPIClientMock) SecretRemove(context.Context, string) error { +func (secretAPIClientMock) SecretRemove(context.Context, string) error { return nil } -func (s secretAPIClientMock) SecretInspectWithRaw(context.Context, string) (swarm.Secret, []byte, error) { +func (secretAPIClientMock) SecretInspectWithRaw(context.Context, string) (swarm.Secret, []byte, error) { return swarm.Secret{}, []byte{}, nil } -func (s secretAPIClientMock) SecretUpdate(context.Context, string, swarm.Version, swarm.SecretSpec) error { +func (secretAPIClientMock) SecretUpdate(context.Context, string, swarm.Version, swarm.SecretSpec) error { return nil }