From 05f73a2236ed44dfd27c4f80371d84a3f166fb0c Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 2 May 2024 21:46:47 +0800 Subject: [PATCH] chore: tweak linter --- bin/memos/main.go | 2 +- plugin/storage/s3/s3.go | 2 +- server/router/api/v1/v1.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/memos/main.go b/bin/memos/main.go index c6605b3b..b2c4eed0 100644 --- a/bin/memos/main.go +++ b/bin/memos/main.go @@ -43,7 +43,7 @@ var ( rootCmd = &cobra.Command{ Use: "memos", Short: `An open source, lightweight note-taking service. Easily capture and share your great thoughts.`, - Run: func(_cmd *cobra.Command, _args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithCancel(context.Background()) dbDriver, err := db.NewDBDriver(instanceProfile) if err != nil { diff --git a/plugin/storage/s3/s3.go b/plugin/storage/s3/s3.go index 3455744d..5e44ff13 100644 --- a/plugin/storage/s3/s3.go +++ b/plugin/storage/s3/s3.go @@ -68,7 +68,7 @@ func (c *Client) UploadObject(ctx context.Context, key string, fileType string, // PresignGetObject presigns an object in S3. func (c *Client) PresignGetObject(ctx context.Context, key string) (string, error) { presignClient := s3.NewPresignClient(c.Client) - presignResult, err := presignClient.PresignGetObject(context.TODO(), &s3.GetObjectInput{ + presignResult, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{ Bucket: aws.String(*c.Bucket), Key: aws.String(key), }, func(opts *s3.PresignOptions) { diff --git a/server/router/api/v1/v1.go b/server/router/api/v1/v1.go index 05ccf8d9..4c9fa7f6 100644 --- a/server/router/api/v1/v1.go +++ b/server/router/api/v1/v1.go @@ -117,7 +117,7 @@ func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Ech // GRPC web proxy. options := []grpcweb.Option{ grpcweb.WithCorsForRegisteredEndpointsOnly(false), - grpcweb.WithOriginFunc(func(origin string) bool { + grpcweb.WithOriginFunc(func(_ string) bool { return true }), }