diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2023-05-10 13:36:19 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2023-05-10 21:52:43 +0200 |
commit | 685b3d820a7f10d1d0b6e90a19f1ba0cf5c2caa2 (patch) | |
tree | eb92d441b66d94ba2ab08fde7ca5d9e7a908451c | |
parent | f70d9933d160b12b8d6247c77e721c94fae9eefe (diff) | |
download | docker-685b3d820a7f10d1d0b6e90a19f1ba0cf5c2caa2.tar.gz |
client: make IsErrNotFound an alias for errdefs.IsNotFound
None of the client will return the old error-types, so there's no need
to keep the compatibility code. We can consider deprecating this function
in favor of the errdefs equivalent this.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
-rw-r--r-- | client/errors.go | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/client/errors.go b/client/errors.go index 6878144c41..aa8a280532 100644 --- a/client/errors.go +++ b/client/errors.go @@ -31,20 +31,10 @@ func ErrorConnectionFailed(host string) error { return errConnectionFailed{host: host} } -// Deprecated: use the errdefs.NotFound() interface instead. Kept for backward compatibility -type notFound interface { - error - NotFound() bool -} - // IsErrNotFound returns true if the error is a NotFound error, which is returned -// by the API when some object is not found. +// by the API when some object is not found. It is an alias for [errdefs.IsNotFound]. func IsErrNotFound(err error) bool { - if errdefs.IsNotFound(err) { - return true - } - var e notFound - return errors.As(err, &e) + return errdefs.IsNotFound(err) } type objectNotFoundError struct { |