зеркало из https://github.com/docker/hub-tool.git
errors.Is for the missing places
Signed-off-by: Moshe Beladev <moshebe123@gmail.com>
This commit is contained in:
Родитель
c728812a30
Коммит
c6cdcd63b5
|
@ -20,6 +20,7 @@ import (
|
|||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/pkg/errors"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/hub-tool/internal/errdef"
|
||||
|
@ -54,7 +55,7 @@ func newRmCmd(streams command.Streams, hubClient *hub.Client, parent string) *co
|
|||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
err := runRm(cmd.Context(), streams, hubClient, opts, args[0])
|
||||
if err == nil || err == errdef.ErrCanceled {
|
||||
if err == nil || errors.Is(err, errdef.ErrCanceled) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
|
|
@ -53,7 +53,7 @@ func newRmCmd(streams command.Streams, hubClient *hub.Client, parent string) *co
|
|||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
err := runRm(cmd.Context(), streams, hubClient, opts, args[0])
|
||||
if err == nil || err == errdef.ErrCanceled {
|
||||
if err == nil || errors.Is(err, errdef.ErrCanceled) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
|
Загрузка…
Ссылка в новой задаче