diff --git a/cli/command/manifest/cmd.go b/cli/command/manifest/cmd.go index a914ef6dbb4b..939f02b7bc5c 100644 --- a/cli/command/manifest/cmd.go +++ b/cli/command/manifest/cmd.go @@ -18,7 +18,7 @@ func NewManifestCommand(dockerCli command.Cli) *cobra.Command { Long: manifestDescription, Args: cli.NoArgs, Run: func(cmd *cobra.Command, args []string) { - fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString()) + _, _ = fmt.Fprint(dockerCli.Err(), "\n"+cmd.UsageString()) }, Annotations: map[string]string{"experimentalCLI": ""}, } diff --git a/cli/command/service/remove.go b/cli/command/service/remove.go index c6e938e13b54..efbd5f9ad063 100644 --- a/cli/command/service/remove.go +++ b/cli/command/service/remove.go @@ -39,10 +39,10 @@ func runRemove(ctx context.Context, dockerCli command.Cli, sids []string) error errs = append(errs, err.Error()) continue } - fmt.Fprintf(dockerCli.Out(), "%s\n", sid) + _, _ = fmt.Fprintf(dockerCli.Out(), "%s\n", sid) } if len(errs) > 0 { - return errors.Errorf(strings.Join(errs, "\n")) + return errors.New(strings.Join(errs, "\n")) } return nil } diff --git a/cli/command/service/scale.go b/cli/command/service/scale.go index fd863049893d..688a3ff2d098 100644 --- a/cli/command/service/scale.go +++ b/cli/command/service/scale.go @@ -90,7 +90,7 @@ func runScale(ctx context.Context, dockerCli command.Cli, options *scaleOptions, if len(errs) == 0 { return nil } - return errors.Errorf(strings.Join(errs, "\n")) + return errors.New(strings.Join(errs, "\n")) } func runServiceScale(ctx context.Context, dockerCli command.Cli, serviceID string, scale uint64) error { diff --git a/cli/command/stack/swarm/remove.go b/cli/command/stack/swarm/remove.go index cde317fe0a66..5641ea24bdf6 100644 --- a/cli/command/stack/swarm/remove.go +++ b/cli/command/stack/swarm/remove.go @@ -48,7 +48,7 @@ func RunRemove(ctx context.Context, dockerCli command.Cli, opts options.Remove) } if len(services)+len(networks)+len(secrets)+len(configs) == 0 { - fmt.Fprintf(dockerCli.Err(), "Nothing found in stack: %s\n", namespace) + _, _ = fmt.Fprintf(dockerCli.Err(), "Nothing found in stack: %s\n", namespace) continue } @@ -71,7 +71,7 @@ func RunRemove(ctx context.Context, dockerCli command.Cli, opts options.Remove) } if len(errs) > 0 { - return errors.Errorf(strings.Join(errs, "\n")) + return errors.New(strings.Join(errs, "\n")) } return nil } diff --git a/cli/command/utils.go b/cli/command/utils.go index b206db8edde0..1cf4d199de02 100644 --- a/cli/command/utils.go +++ b/cli/command/utils.go @@ -222,7 +222,7 @@ func ValidateOutputPath(path string) error { } if err := ValidateOutputPathFileMode(fileInfo.Mode()); err != nil { - return errors.Wrapf(err, fmt.Sprintf("invalid output path: %q must be a directory or a regular file", path)) + return errors.Wrapf(err, "invalid output path: %q must be a directory or a regular file", path) } } return nil