From 9823719138d23209c6542f0452c46b5977427fac Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Fri, 29 Sep 2023 09:37:24 +1000 Subject: [PATCH] Removes Deprecated functions for V2 prep. In v1 of this repo we deprecated Is* style functions in favour of the Go std lib errors.Is(). This change removes all the functions for a new lean and mean errors release. --- errortypes.go | 90 --------------------------------------------------- 1 file changed, 90 deletions(-) diff --git a/errortypes.go b/errortypes.go index 0029f91d..48d39c39 100644 --- a/errortypes.go +++ b/errortypes.go @@ -130,12 +130,6 @@ func NewTimeout(err error, msg string) error { } } -// Deprecated: IsTimeout reports whether err is a Timeout error. Use -// Is(err, Timeout). -func IsTimeout(err error) bool { - return Is(err, Timeout) -} - // NotFoundf returns an error which satisfies Is(err, NotFound) and the // Locationer interface. func NotFoundf(format string, args ...interface{}) error { @@ -154,12 +148,6 @@ func NewNotFound(err error, msg string) error { } } -// Deprecated: IsNotFound reports whether err is a NotFound error. Use -// Is(err, NotFound). -func IsNotFound(err error) bool { - return Is(err, NotFound) -} - // UserNotFoundf returns an error which satisfies Is(err, UserNotFound) and the // Locationer interface. func UserNotFoundf(format string, args ...interface{}) error { @@ -178,12 +166,6 @@ func NewUserNotFound(err error, msg string) error { } } -// Deprecated: IsUserNotFound reports whether err is a UserNotFound error. Use -// Is(err, UserNotFound). -func IsUserNotFound(err error) bool { - return Is(err, UserNotFound) -} - // Unauthorizedf returns an error that satisfies Is(err, Unauthorized) and // the Locationer interface. func Unauthorizedf(format string, args ...interface{}) error { @@ -202,12 +184,6 @@ func NewUnauthorized(err error, msg string) error { } } -// Deprecated: IsUnauthorized reports whether err is a Unauthorized error. Use -// Is(err, Unauthorized). -func IsUnauthorized(err error) bool { - return Is(err, Unauthorized) -} - // NotImplementedf returns an error which satisfies Is(err, NotImplemented) and // the Locationer interface. func NotImplementedf(format string, args ...interface{}) error { @@ -226,12 +202,6 @@ func NewNotImplemented(err error, msg string) error { } } -// Deprecated: IsNotImplemented reports whether err is a NotImplemented error. -// Use Is(err, NotImplemented). -func IsNotImplemented(err error) bool { - return Is(err, NotImplemented) -} - // AlreadyExistsf returns an error which satisfies Is(err, AlreadyExists) and // the Locationer interface. func AlreadyExistsf(format string, args ...interface{}) error { @@ -250,12 +220,6 @@ func NewAlreadyExists(err error, msg string) error { } } -// Deprecated: IsAlreadyExists reports whether the err is a AlreadyExists -// error. Use Is(err, AlreadyExists). -func IsAlreadyExists(err error) bool { - return Is(err, AlreadyExists) -} - // NotSupportedf returns an error which satisfies Is(err, NotSupported) and the // Locationer interface. func NotSupportedf(format string, args ...interface{}) error { @@ -274,12 +238,6 @@ func NewNotSupported(err error, msg string) error { } } -// Deprecated: IsNotSupported reports whether err is a NotSupported error. Use -// Is(err, NotSupported). -func IsNotSupported(err error) bool { - return Is(err, NotSupported) -} - // NotValidf returns an error which satisfies Is(err, NotValid) and the // Locationer interface. func NotValidf(format string, args ...interface{}) error { @@ -298,12 +256,6 @@ func NewNotValid(err error, msg string) error { } } -// Deprecated: IsNotValid reports whether err is a NotValid error. Use -// Is(err, NotValid). -func IsNotValid(err error) bool { - return Is(err, NotValid) -} - // NotProvisionedf returns an error which satisfies Is(err, NotProvisioned) and // the Locationer interface. func NotProvisionedf(format string, args ...interface{}) error { @@ -322,12 +274,6 @@ func NewNotProvisioned(err error, msg string) error { } } -// Deprecated: IsNotProvisioned reports whether err is a NotProvisioned error. -// Use Is(err, NotProvisioned). -func IsNotProvisioned(err error) bool { - return Is(err, NotProvisioned) -} - // NotAssignedf returns an error which satisfies Is(err, NotAssigned) and the // Locationer interface. func NotAssignedf(format string, args ...interface{}) error { @@ -346,12 +292,6 @@ func NewNotAssigned(err error, msg string) error { } } -// Deprecated: IsNotAssigned reports whether err is a NotAssigned error. -// Use Is(err, NotAssigned) -func IsNotAssigned(err error) bool { - return Is(err, NotAssigned) -} - // BadRequestf returns an error which satisfies Is(err, BadRequest) and the // Locationer interface. func BadRequestf(format string, args ...interface{}) error { @@ -370,12 +310,6 @@ func NewBadRequest(err error, msg string) error { } } -// Deprecated: IsBadRequest reports whether err is a BadRequest error. -// Use Is(err, BadRequest) -func IsBadRequest(err error) bool { - return Is(err, BadRequest) -} - // MethodNotAllowedf returns an error which satisfies Is(err, MethodNotAllowed) // and the Locationer interface. func MethodNotAllowedf(format string, args ...interface{}) error { @@ -394,12 +328,6 @@ func NewMethodNotAllowed(err error, msg string) error { } } -// Deprecated: IsMethodNotAllowed reports whether err is a MethodNotAllowed -// error. Use Is(err, MethodNotAllowed) -func IsMethodNotAllowed(err error) bool { - return Is(err, MethodNotAllowed) -} - // Forbiddenf returns an error which satistifes Is(err, Forbidden) and the // Locationer interface. func Forbiddenf(format string, args ...interface{}) error { @@ -418,12 +346,6 @@ func NewForbidden(err error, msg string) error { } } -// Deprecated: IsForbidden reports whether err is a Forbidden error. Use -// Is(err, Forbidden). -func IsForbidden(err error) bool { - return Is(err, Forbidden) -} - // QuotaLimitExceededf returns an error which satisfies // Is(err, QuotaLimitExceeded) and the Locationer interface. func QuotaLimitExceededf(format string, args ...interface{}) error { @@ -442,12 +364,6 @@ func NewQuotaLimitExceeded(err error, msg string) error { } } -// Deprecated: IsQuotaLimitExceeded reports whether err is a QuoteLimitExceeded -// err. Use Is(err, QuotaLimitExceeded). -func IsQuotaLimitExceeded(err error) bool { - return Is(err, QuotaLimitExceeded) -} - // NotYetAvailablef returns an error which satisfies Is(err, NotYetAvailable) // and the Locationer interface. func NotYetAvailablef(format string, args ...interface{}) error { @@ -465,9 +381,3 @@ func NewNotYetAvailable(err error, msg string) error { errType: NotYetAvailable, } } - -// Deprecated: IsNotYetAvailable reports whether err is a NotYetAvailable err. -// Use Is(err, NotYetAvailable) -func IsNotYetAvailable(err error) bool { - return Is(err, NotYetAvailable) -}