Skip to content

Commit

Permalink
mark deprecated on pkg.go.dev (#531)
Browse files Browse the repository at this point in the history
The godoc of deprecated types, values and functions should be match
the regexp `(^|\n\s*\n)\s*Deprecated:`.

https://github.com/golang/pkgsite/blob/8996ff632abee854aef1b764ca0501f262f8f523/internal/godoc/dochtml/deprecated.go#L12-L13

pkg.go.dev marks these items deprecated
and show them using a special style.

Co-authored-by: Lahiru Maramba <llahiru@gmail.com>
  • Loading branch information
shogo82148 and lahirumaramba committed Apr 6, 2023
1 parent 5779279 commit ca0bfd9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions auth/user_mgt.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func IsEmailNotFound(err error) bool {

// IsInsufficientPermission checks if the given error was due to insufficient permissions.
//
// Deprecated. Always returns false.
// Deprecated: Always returns false.
func IsInsufficientPermission(err error) bool {
return false
}
Expand All @@ -533,7 +533,7 @@ func IsInvalidDynamicLinkDomain(err error) bool {

// IsInvalidEmail checks if the given error was due to an invalid email.
//
// Deprecated. Always returns false.
// Deprecated: Always returns false.
func IsInvalidEmail(err error) bool {
return false
}
Expand All @@ -545,7 +545,7 @@ func IsPhoneNumberAlreadyExists(err error) bool {

// IsProjectNotFound checks if the given error was due to a non-existing project.
//
// Deprecated. Always returns false.
// Deprecated: Always returns false.
func IsProjectNotFound(err error) bool {
return false
}
Expand All @@ -567,7 +567,7 @@ func IsUnauthorizedContinueURI(err error) bool {

// IsUnknown checks if the given error was due to a unknown server error.
//
// Deprecated. Always returns false.
// Deprecated: Always returns false.
func IsUnknown(err error) bool {
return false
}
Expand Down Expand Up @@ -724,7 +724,7 @@ func (c *baseClient) GetUserByPhoneNumber(ctx context.Context, phone string) (*U

// GetUserByProviderID is an alias for GetUserByProviderUID.
//
// Deprecated. Use GetUserByProviderUID instead.
// Deprecated: Use GetUserByProviderUID instead.
func (c *baseClient) GetUserByProviderID(ctx context.Context, providerID string, providerUID string) (*UserRecord, error) {
return c.GetUserByProviderUID(ctx, providerID, providerUID)
}
Expand Down
14 changes: 7 additions & 7 deletions iid/iid.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var errorMessages = map[int]string{

// IsInvalidArgument checks if the given error was due to an invalid instance ID argument.
//
// Deprecated. Use errorutils.IsInvalidArgument() function instead.
// Deprecated: Use errorutils.IsInvalidArgument() function instead.
func IsInvalidArgument(err error) bool {
return errorutils.IsInvalidArgument(err)
}
Expand All @@ -50,7 +50,7 @@ func IsInvalidArgument(err error) bool {
// required authorization. This could be due to the client not having the required permission
// or the specified instance ID not matching the target Firebase project.
//
// Deprecated. Use errorutils.IsUnauthenticated() or errorutils.IsPermissionDenied() instead.
// Deprecated: Use errorutils.IsUnauthenticated() or errorutils.IsPermissionDenied() instead.
func IsInsufficientPermission(err error) bool {
return errorutils.IsUnauthenticated(err) || errorutils.IsPermissionDenied(err)
}
Expand All @@ -63,37 +63,37 @@ func IsNotFound(err error) bool {
// IsAlreadyDeleted checks if the given error was due to the instance ID being already deleted from
// the project.
//
// Deprecated. Use errorutils.IsConflict() function instead.
// Deprecated: Use errorutils.IsConflict() function instead.
func IsAlreadyDeleted(err error) bool {
return errorutils.IsConflict(err)
}

// IsTooManyRequests checks if the given error was due to the client sending too many requests
// causing a server quota to exceed.
//
// Deprecated. Use errorutils.IsResourceExhausted() function instead.
// Deprecated: Use errorutils.IsResourceExhausted() function instead.
func IsTooManyRequests(err error) bool {
return errorutils.IsResourceExhausted(err)
}

// IsInternal checks if the given error was due to an internal server error.
//
// Deprecated. Use errorutils.IsInternal() function instead.
// Deprecated: Use errorutils.IsInternal() function instead.
func IsInternal(err error) bool {
return errorutils.IsInternal(err)
}

// IsServerUnavailable checks if the given error was due to the backend server being temporarily
// unavailable.
//
// Deprecated. Use errorutils.IsUnavailable() function instead.
// Deprecated: Use errorutils.IsUnavailable() function instead.
func IsServerUnavailable(err error) bool {
return errorutils.IsUnavailable(err)
}

// IsUnknown checks if the given error was due to unknown error returned by the backend server.
//
// Deprecated. Use errorutils.IsUnknown() function instead.
// Deprecated: Use errorutils.IsUnknown() function instead.
func IsUnknown(err error) bool {
return errorutils.IsUnknown(err)
}
Expand Down
14 changes: 7 additions & 7 deletions messaging/messaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ func IsInternal(err error) bool {
// IsInvalidAPNSCredentials checks if the given error was due to invalid APNS certificate or auth
// key.
//
// Deprecated. Use IsThirdPartyAuthError().
// Deprecated: Use IsThirdPartyAuthError().
func IsInvalidAPNSCredentials(err error) bool {
return IsThirdPartyAuthError(err)
}
Expand All @@ -973,7 +973,7 @@ func IsInvalidArgument(err error) bool {

// IsMessageRateExceeded checks if the given error was due to the client exceeding a quota.
//
// Deprecated. Use IsQuotaExceeded().
// Deprecated: Use IsQuotaExceeded().
func IsMessageRateExceeded(err error) bool {
return IsQuotaExceeded(err)
}
Expand All @@ -986,7 +986,7 @@ func IsQuotaExceeded(err error) bool {
// IsMismatchedCredential checks if the given error was due to an invalid credential or permission
// error.
//
// Deprecated. Use IsSenderIDMismatch().
// Deprecated: Use IsSenderIDMismatch().
func IsMismatchedCredential(err error) bool {
return IsSenderIDMismatch(err)
}
Expand All @@ -1000,7 +1000,7 @@ func IsSenderIDMismatch(err error) bool {
// IsRegistrationTokenNotRegistered checks if the given error was due to a registration token that
// became invalid.
//
// Deprecated. Use IsUnregistered().
// Deprecated: Use IsUnregistered().
func IsRegistrationTokenNotRegistered(err error) bool {
return IsUnregistered(err)
}
Expand All @@ -1014,7 +1014,7 @@ func IsUnregistered(err error) bool {
// IsServerUnavailable checks if the given error was due to the backend server being temporarily
// unavailable.
//
// Deprecated. Use IsUnavailable().
// Deprecated: Use IsUnavailable().
func IsServerUnavailable(err error) bool {
return IsUnavailable(err)
}
Expand All @@ -1028,14 +1028,14 @@ func IsUnavailable(err error) bool {
// IsTooManyTopics checks if the given error was due to the client exceeding the allowed number
// of topics.
//
// Deprecated. Always returns false.
// Deprecated: Always returns false.
func IsTooManyTopics(err error) bool {
return false
}

// IsUnknown checks if the given error was due to unknown error returned by the backend server.
//
// Deprecated. Always returns false.
// Deprecated: Always returns false.
func IsUnknown(err error) bool {
return false
}
Expand Down

0 comments on commit ca0bfd9

Please sign in to comment.