File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,12 +2,11 @@ package manifest
22
33import (
44 "context"
5- "strings "
5+ "errors "
66
77 "github.com/docker/cli/cli"
88 "github.com/docker/cli/cli/command"
99 manifeststore "github.com/docker/cli/cli/manifest/store"
10- "github.com/pkg/errors"
1110 "github.com/spf13/cobra"
1211)
1312
@@ -25,28 +24,25 @@ func newRmManifestListCommand(dockerCLI command.Cli) *cobra.Command {
2524}
2625
2726func runRemove (ctx context.Context , store manifeststore.Store , targets []string ) error {
28- var errs []string
27+ var errs []error
2928 for _ , target := range targets {
3029 if ctx .Err () != nil {
3130 return ctx .Err ()
3231 }
3332 targetRef , err := normalizeReference (target )
3433 if err != nil {
35- errs = append (errs , err . Error () )
34+ errs = append (errs , err )
3635 continue
3736 }
3837 _ , err = store .GetList (targetRef )
3938 if err != nil {
40- errs = append (errs , err . Error () )
39+ errs = append (errs , err )
4140 continue
4241 }
4342 err = store .Remove (targetRef )
4443 if err != nil {
45- errs = append (errs , err . Error () )
44+ errs = append (errs , err )
4645 }
4746 }
48- if len (errs ) > 0 {
49- return errors .New (strings .Join (errs , "\n " ))
50- }
51- return nil
47+ return errors .Join (errs ... )
5248}
You can’t perform that action at this time.
0 commit comments