mirror of
https://github.com/usememos/memos.git
synced 2025-12-19 07:08:55 +08:00
style: fix golangci-lint issues in memo_service.go
- Replace 'else {if}' with 'else if' (gocritic)
- Fix multi-line condition indentation (goimports)
This commit is contained in:
parent
652c855145
commit
9fcf654b40
1 changed files with 4 additions and 6 deletions
|
|
@ -34,12 +34,10 @@ func (s *APIV1Service) CreateMemo(ctx context.Context, request *v1pb.CreateMemoR
|
|||
memoUID := strings.TrimSpace(request.MemoId)
|
||||
if memoUID == "" {
|
||||
memoUID = shortuuid.New()
|
||||
} else {
|
||||
} else if !base.UIDMatcher.MatchString(memoUID) {
|
||||
// Validate custom memo ID format
|
||||
if !base.UIDMatcher.MatchString(memoUID) {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "invalid memo_id format: must be 1-32 characters, alphanumeric and hyphens only, cannot start or end with hyphen")
|
||||
}
|
||||
}
|
||||
|
||||
create := &store.Memo{
|
||||
UID: memoUID,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue