mirror of
https://github.com/usememos/memos.git
synced 2025-11-11 18:00:53 +08:00
chore: fix linter
This commit is contained in:
parent
8f51791da8
commit
9971cbeed4
1 changed files with 0 additions and 16 deletions
|
|
@ -144,19 +144,3 @@ func ExtractActivityIDFromName(name string) (int32, error) {
|
|||
}
|
||||
return id, nil
|
||||
}
|
||||
|
||||
// ExtractWebhookIDFromName returns the webhook ID from a resource name.
|
||||
func ExtractWebhookIDFromName(name string) (string, error) {
|
||||
tokens, err := GetNameParentTokens(name, UserNamePrefix, WebhookNamePrefix)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(tokens) != 2 {
|
||||
return "", errors.Errorf("invalid webhook name format: %q", name)
|
||||
}
|
||||
webhookID := tokens[1]
|
||||
if webhookID == "" {
|
||||
return "", errors.Errorf("invalid webhook ID %q", webhookID)
|
||||
}
|
||||
return webhookID, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue