Skip to content

Commit 3d68a39

Browse files
committed
cli/command/system: remove errdefs uses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 2517256 commit 3d68a39

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cli/command/system/prune.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/docker/cli/internal/prompt"
1919
"github.com/docker/cli/opts"
2020
"github.com/docker/docker/api/types/versions"
21-
"github.com/docker/docker/errdefs"
2221
"github.com/docker/go-units"
2322
"github.com/fvbommel/sortorder"
2423
"github.com/pkg/errors"
@@ -83,7 +82,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
8382
return err
8483
}
8584
if !r {
86-
return errdefs.Cancelled(errors.New("system prune has been cancelled"))
85+
return cancelledErr{errors.New("system prune has been cancelled")}
8786
}
8887
}
8988
pruneFuncs := []func(ctx context.Context, dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error){
@@ -115,6 +114,10 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
115114
return nil
116115
}
117116

117+
type cancelledErr struct{ error }
118+
119+
func (cancelledErr) Cancelled() {}
120+
118121
// confirmationMessage constructs a confirmation message that depends on the cli options.
119122
func confirmationMessage(dockerCli command.Cli, options pruneOptions) string {
120123
t := template.Must(template.New("confirmation message").Parse(confirmationTemplate))

0 commit comments

Comments
 (0)