(ctx context.Context, dockerCLI command.Cli, opts *removeOptions)
| 42 | } |
| 43 | |
| 44 | func runRemove(ctx context.Context, dockerCLI command.Cli, opts *removeOptions) error { |
| 45 | apiClient := dockerCLI.Client() |
| 46 | |
| 47 | var errs []error |
| 48 | for _, name := range opts.volumes { |
| 49 | _, err := apiClient.VolumeRemove(ctx, name, client.VolumeRemoveOptions{ |
| 50 | Force: opts.force, |
| 51 | }) |
| 52 | if err != nil { |
| 53 | errs = append(errs, err) |
| 54 | continue |
| 55 | } |
| 56 | _, _ = fmt.Fprintln(dockerCLI.Out(), name) |
| 57 | } |
| 58 | return errors.Join(errs...) |
| 59 | } |
no test coverage detected
searching dependent graphs…