Skip to content

Commit 10f5b3f

Browse files
committed
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 <github@gone.nl>
1 parent 299aae0 commit 10f5b3f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cli/command/volume/remove.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ func newRemoveCommand(dockerCli command.Cli) *cobra.Command {
4141
return cmd
4242
}
4343

44-
func runRemove(ctx context.Context, dockerCli command.Cli, opts *removeOptions) error {
45-
client := dockerCli.Client()
44+
func runRemove(ctx context.Context, dockerCLI command.Cli, opts *removeOptions) error {
45+
apiClient := dockerCLI.Client()
4646

4747
var errs []string
4848

4949
for _, name := range opts.volumes {
50-
if err := client.VolumeRemove(ctx, name, opts.force); err != nil {
50+
if err := apiClient.VolumeRemove(ctx, name, opts.force); err != nil {
5151
errs = append(errs, err.Error())
5252
continue
5353
}
54-
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
54+
_, _ = fmt.Fprintln(dockerCLI.Out(), name)
5555
}
5656

5757
if len(errs) > 0 {

0 commit comments

Comments
 (0)