File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,14 +36,16 @@ func newRemoveCommand(dockerCli command.Cli) *cobra.Command {
3636 return cmd
3737}
3838
39- func runRemove (ctx context.Context , dockerCli command.Cli , opts * rmOptions ) error {
40- var errs error
39+ func runRemove (ctx context.Context , dockerCLI command.Cli , opts * rmOptions ) error {
40+ apiClient := dockerCLI .Client ()
41+
42+ var errs []error
4143 for _ , name := range opts .plugins {
42- if err := dockerCli . Client () .PluginRemove (ctx , name , types.PluginRemoveOptions {Force : opts .force }); err != nil {
43- errs = errors . Join (errs , err )
44+ if err := apiClient .PluginRemove (ctx , name , types.PluginRemoveOptions {Force : opts .force }); err != nil {
45+ errs = append (errs , err )
4446 continue
4547 }
46- _ , _ = fmt .Fprintln (dockerCli .Out (), name )
48+ _ , _ = fmt .Fprintln (dockerCLI .Out (), name )
4749 }
48- return errs
50+ return errors . Join ( errs ... )
4951}
You can’t perform that action at this time.
0 commit comments