fix: correct typos in comments, error messages, and identifiers (#5704)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
memoclaw 2026-03-08 18:40:17 +08:00 committed by GitHub
parent bdd3554b89
commit 8f43e8075b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 29 additions and 29 deletions

View file

@ -12,7 +12,7 @@ import (
// Configuration options for creating a parser. Most options specify which // Configuration options for creating a parser. Most options specify which
// fields should be included, while others enable features. If a field is not // fields should be included, while others enable features. If a field is not
// included the parser will assume a default value. These options do not change // included the parser will assume a default value. These options do not change
// the order fields are parse in. // the order fields are parsed in.
type ParseOption int type ParseOption int
const ( const (

View file

@ -82,7 +82,7 @@ func (p *IdentityProvider) UserInfo(token string) (*idp.IdentityProviderUserInfo
client := &http.Client{} client := &http.Client{}
req, err := http.NewRequest(http.MethodGet, p.config.UserInfoUrl, nil) req, err := http.NewRequest(http.MethodGet, p.config.UserInfoUrl, nil)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to new http request") return nil, errors.Wrap(err, "failed to create http request")
} }
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))

View file

@ -74,7 +74,7 @@ func (c *Client) PresignGetObject(ctx context.Context, key string) (string, erro
opts.Expires = time.Duration(5 * 24 * time.Hour) opts.Expires = time.Duration(5 * 24 * time.Hour)
}) })
if err != nil { if err != nil {
return "", errors.Wrap(err, "failed to presign put object") return "", errors.Wrap(err, "failed to presign get object")
} }
return presignResult.URL, nil return presignResult.URL, nil
} }

View file

@ -25,12 +25,12 @@ service AttachmentService {
rpc ListAttachments(ListAttachmentsRequest) returns (ListAttachmentsResponse) { rpc ListAttachments(ListAttachmentsRequest) returns (ListAttachmentsResponse) {
option (google.api.http) = {get: "/api/v1/attachments"}; option (google.api.http) = {get: "/api/v1/attachments"};
} }
// GetAttachment returns a attachment by name. // GetAttachment returns an attachment by name.
rpc GetAttachment(GetAttachmentRequest) returns (Attachment) { rpc GetAttachment(GetAttachmentRequest) returns (Attachment) {
option (google.api.http) = {get: "/api/v1/{name=attachments/*}"}; option (google.api.http) = {get: "/api/v1/{name=attachments/*}"};
option (google.api.method_signature) = "name"; option (google.api.method_signature) = "name";
} }
// UpdateAttachment updates a attachment. // UpdateAttachment updates an attachment.
rpc UpdateAttachment(UpdateAttachmentRequest) returns (Attachment) { rpc UpdateAttachment(UpdateAttachmentRequest) returns (Attachment) {
option (google.api.http) = { option (google.api.http) = {
patch: "/api/v1/{attachment.name=attachments/*}" patch: "/api/v1/{attachment.name=attachments/*}"
@ -38,7 +38,7 @@ service AttachmentService {
}; };
option (google.api.method_signature) = "attachment,update_mask"; option (google.api.method_signature) = "attachment,update_mask";
} }
// DeleteAttachment deletes a attachment by name. // DeleteAttachment deletes an attachment by name.
rpc DeleteAttachment(DeleteAttachmentRequest) returns (google.protobuf.Empty) { rpc DeleteAttachment(DeleteAttachmentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{name=attachments/*}"}; option (google.api.http) = {delete: "/api/v1/{name=attachments/*}"};
option (google.api.method_signature) = "name"; option (google.api.method_signature) = "name";

View file

@ -57,11 +57,11 @@ type AttachmentServiceClient interface {
CreateAttachment(context.Context, *connect.Request[v1.CreateAttachmentRequest]) (*connect.Response[v1.Attachment], error) CreateAttachment(context.Context, *connect.Request[v1.CreateAttachmentRequest]) (*connect.Response[v1.Attachment], error)
// ListAttachments lists all attachments. // ListAttachments lists all attachments.
ListAttachments(context.Context, *connect.Request[v1.ListAttachmentsRequest]) (*connect.Response[v1.ListAttachmentsResponse], error) ListAttachments(context.Context, *connect.Request[v1.ListAttachmentsRequest]) (*connect.Response[v1.ListAttachmentsResponse], error)
// GetAttachment returns a attachment by name. // GetAttachment returns an attachment by name.
GetAttachment(context.Context, *connect.Request[v1.GetAttachmentRequest]) (*connect.Response[v1.Attachment], error) GetAttachment(context.Context, *connect.Request[v1.GetAttachmentRequest]) (*connect.Response[v1.Attachment], error)
// UpdateAttachment updates a attachment. // UpdateAttachment updates an attachment.
UpdateAttachment(context.Context, *connect.Request[v1.UpdateAttachmentRequest]) (*connect.Response[v1.Attachment], error) UpdateAttachment(context.Context, *connect.Request[v1.UpdateAttachmentRequest]) (*connect.Response[v1.Attachment], error)
// DeleteAttachment deletes a attachment by name. // DeleteAttachment deletes an attachment by name.
DeleteAttachment(context.Context, *connect.Request[v1.DeleteAttachmentRequest]) (*connect.Response[emptypb.Empty], error) DeleteAttachment(context.Context, *connect.Request[v1.DeleteAttachmentRequest]) (*connect.Response[emptypb.Empty], error)
} }
@ -149,11 +149,11 @@ type AttachmentServiceHandler interface {
CreateAttachment(context.Context, *connect.Request[v1.CreateAttachmentRequest]) (*connect.Response[v1.Attachment], error) CreateAttachment(context.Context, *connect.Request[v1.CreateAttachmentRequest]) (*connect.Response[v1.Attachment], error)
// ListAttachments lists all attachments. // ListAttachments lists all attachments.
ListAttachments(context.Context, *connect.Request[v1.ListAttachmentsRequest]) (*connect.Response[v1.ListAttachmentsResponse], error) ListAttachments(context.Context, *connect.Request[v1.ListAttachmentsRequest]) (*connect.Response[v1.ListAttachmentsResponse], error)
// GetAttachment returns a attachment by name. // GetAttachment returns an attachment by name.
GetAttachment(context.Context, *connect.Request[v1.GetAttachmentRequest]) (*connect.Response[v1.Attachment], error) GetAttachment(context.Context, *connect.Request[v1.GetAttachmentRequest]) (*connect.Response[v1.Attachment], error)
// UpdateAttachment updates a attachment. // UpdateAttachment updates an attachment.
UpdateAttachment(context.Context, *connect.Request[v1.UpdateAttachmentRequest]) (*connect.Response[v1.Attachment], error) UpdateAttachment(context.Context, *connect.Request[v1.UpdateAttachmentRequest]) (*connect.Response[v1.Attachment], error)
// DeleteAttachment deletes a attachment by name. // DeleteAttachment deletes an attachment by name.
DeleteAttachment(context.Context, *connect.Request[v1.DeleteAttachmentRequest]) (*connect.Response[emptypb.Empty], error) DeleteAttachment(context.Context, *connect.Request[v1.DeleteAttachmentRequest]) (*connect.Response[emptypb.Empty], error)
} }

View file

@ -35,11 +35,11 @@ type AttachmentServiceClient interface {
CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error)
// ListAttachments lists all attachments. // ListAttachments lists all attachments.
ListAttachments(ctx context.Context, in *ListAttachmentsRequest, opts ...grpc.CallOption) (*ListAttachmentsResponse, error) ListAttachments(ctx context.Context, in *ListAttachmentsRequest, opts ...grpc.CallOption) (*ListAttachmentsResponse, error)
// GetAttachment returns a attachment by name. // GetAttachment returns an attachment by name.
GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error)
// UpdateAttachment updates a attachment. // UpdateAttachment updates an attachment.
UpdateAttachment(ctx context.Context, in *UpdateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) UpdateAttachment(ctx context.Context, in *UpdateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error)
// DeleteAttachment deletes a attachment by name. // DeleteAttachment deletes an attachment by name.
DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
} }
@ -109,11 +109,11 @@ type AttachmentServiceServer interface {
CreateAttachment(context.Context, *CreateAttachmentRequest) (*Attachment, error) CreateAttachment(context.Context, *CreateAttachmentRequest) (*Attachment, error)
// ListAttachments lists all attachments. // ListAttachments lists all attachments.
ListAttachments(context.Context, *ListAttachmentsRequest) (*ListAttachmentsResponse, error) ListAttachments(context.Context, *ListAttachmentsRequest) (*ListAttachmentsResponse, error)
// GetAttachment returns a attachment by name. // GetAttachment returns an attachment by name.
GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error) GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error)
// UpdateAttachment updates a attachment. // UpdateAttachment updates an attachment.
UpdateAttachment(context.Context, *UpdateAttachmentRequest) (*Attachment, error) UpdateAttachment(context.Context, *UpdateAttachmentRequest) (*Attachment, error)
// DeleteAttachment deletes a attachment by name. // DeleteAttachment deletes an attachment by name.
DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error) DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedAttachmentServiceServer() mustEmbedUnimplementedAttachmentServiceServer()
} }

View file

@ -158,7 +158,7 @@ paths:
get: get:
tags: tags:
- AttachmentService - AttachmentService
description: GetAttachment returns a attachment by name. description: GetAttachment returns an attachment by name.
operationId: AttachmentService_GetAttachment operationId: AttachmentService_GetAttachment
parameters: parameters:
- name: attachment - name: attachment
@ -183,7 +183,7 @@ paths:
delete: delete:
tags: tags:
- AttachmentService - AttachmentService
description: DeleteAttachment deletes a attachment by name. description: DeleteAttachment deletes an attachment by name.
operationId: AttachmentService_DeleteAttachment operationId: AttachmentService_DeleteAttachment
parameters: parameters:
- name: attachment - name: attachment
@ -205,7 +205,7 @@ paths:
patch: patch:
tags: tags:
- AttachmentService - AttachmentService
description: UpdateAttachment updates a attachment. description: UpdateAttachment updates an attachment.
operationId: AttachmentService_UpdateAttachment operationId: AttachmentService_UpdateAttachment
parameters: parameters:
- name: attachment - name: attachment

View file

@ -352,7 +352,7 @@ func convertAttachmentFromStore(attachment *store.Attachment) *v1pb.Attachment {
return attachmentMessage return attachmentMessage
} }
// SaveAttachmentBlob save the blob of attachment based on the storage config. // SaveAttachmentBlob saves the blob of attachment based on the storage config.
func SaveAttachmentBlob(ctx context.Context, profile *profile.Profile, stores *store.Store, create *store.Attachment) error { func SaveAttachmentBlob(ctx context.Context, profile *profile.Profile, stores *store.Store, create *store.Attachment) error {
instanceStorageSetting, err := stores.GetInstanceStorageSetting(ctx) instanceStorageSetting, err := stores.GetInstanceStorageSetting(ctx)
if err != nil { if err != nil {

View file

@ -29,7 +29,7 @@ func NewDB(profile *profile.Profile) (store.Driver, error) {
driver := DB{profile: profile} driver := DB{profile: profile}
driver.config, err = mysql.ParseDSN(dsn) driver.config, err = mysql.ParseDSN(dsn)
if err != nil { if err != nil {
return nil, errors.New("Parse DSN eroor") return nil, errors.New("Parse DSN error")
} }
driver.db, err = sql.Open("mysql", dsn) driver.db, err = sql.Open("mysql", dsn)

View file

@ -288,7 +288,7 @@ export const AttachmentService: GenService<{
output: typeof ListAttachmentsResponseSchema; output: typeof ListAttachmentsResponseSchema;
}, },
/** /**
* GetAttachment returns a attachment by name. * GetAttachment returns an attachment by name.
* *
* @generated from rpc memos.api.v1.AttachmentService.GetAttachment * @generated from rpc memos.api.v1.AttachmentService.GetAttachment
*/ */
@ -298,7 +298,7 @@ export const AttachmentService: GenService<{
output: typeof AttachmentSchema; output: typeof AttachmentSchema;
}, },
/** /**
* UpdateAttachment updates a attachment. * UpdateAttachment updates an attachment.
* *
* @generated from rpc memos.api.v1.AttachmentService.UpdateAttachment * @generated from rpc memos.api.v1.AttachmentService.UpdateAttachment
*/ */
@ -308,7 +308,7 @@ export const AttachmentService: GenService<{
output: typeof AttachmentSchema; output: typeof AttachmentSchema;
}, },
/** /**
* DeleteAttachment deletes a attachment by name. * DeleteAttachment deletes an attachment by name.
* *
* @generated from rpc memos.api.v1.AttachmentService.DeleteAttachment * @generated from rpc memos.api.v1.AttachmentService.DeleteAttachment
*/ */

View file

@ -66,7 +66,7 @@ export const useTranslate = (): TypedT => {
return t; return t;
}; };
export const isValidateLocale = (locale: string | undefined | null): boolean => { export const isValidLocale = (locale: string | undefined | null): boolean => {
if (!locale) return false; if (!locale) return false;
return locales.includes(locale); return locales.includes(locale);
}; };
@ -77,7 +77,7 @@ export const isValidateLocale = (locale: string | undefined | null): boolean =>
// 3. Browser language preference // 3. Browser language preference
export const getLocaleWithFallback = (userLocale?: string): Locale => { export const getLocaleWithFallback = (userLocale?: string): Locale => {
// Priority 1: User setting (if logged in and valid) // Priority 1: User setting (if logged in and valid)
if (userLocale && isValidateLocale(userLocale)) { if (userLocale && isValidLocale(userLocale)) {
return userLocale as Locale; return userLocale as Locale;
} }
@ -93,7 +93,7 @@ export const getLocaleWithFallback = (userLocale?: string): Locale => {
// Applies and persists a locale setting // Applies and persists a locale setting
export const loadLocale = (locale: string): Locale => { export const loadLocale = (locale: string): Locale => {
const validLocale = isValidateLocale(locale) ? (locale as Locale) : findNearestMatchedLanguage(navigator.language); const validLocale = isValidLocale(locale) ? (locale as Locale) : findNearestMatchedLanguage(navigator.language);
setStoredLocale(validLocale); setStoredLocale(validLocale);
i18n.changeLanguage(validLocale); i18n.changeLanguage(validLocale);
return validLocale; return validLocale;