From 10f5b3f73a7f87beecf47369d99874dfeea1266e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 1 Feb 2025 23:13:59 +0100 Subject: [PATCH] cli/command/volumes: minor cleanups: use Println, rename vars - use Println to print newline instead of custom format - use apiClient instead of client for the API client to prevent shadowing imports. - use dockerCLI with Go's standard camelCase casing. - suppress some errors to make my IDE and linters happier Signed-off-by: Sebastiaan van Stijn --- cli/command/volume/remove.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/command/volume/remove.go b/cli/command/volume/remove.go index df3dfe79a0..c436182d63 100644 --- a/cli/command/volume/remove.go +++ b/cli/command/volume/remove.go @@ -41,17 +41,17 @@ func newRemoveCommand(dockerCli command.Cli) *cobra.Command { return cmd } -func runRemove(ctx context.Context, dockerCli command.Cli, opts *removeOptions) error { - client := dockerCli.Client() +func runRemove(ctx context.Context, dockerCLI command.Cli, opts *removeOptions) error { + apiClient := dockerCLI.Client() var errs []string for _, name := range opts.volumes { - if err := client.VolumeRemove(ctx, name, opts.force); err != nil { + if err := apiClient.VolumeRemove(ctx, name, opts.force); err != nil { errs = append(errs, err.Error()) continue } - fmt.Fprintf(dockerCli.Out(), "%s\n", name) + _, _ = fmt.Fprintln(dockerCLI.Out(), name) } if len(errs) > 0 {