chore: tweak linter warnings

This commit is contained in:
Steven 2024-08-20 08:25:34 +08:00
parent 2999f472dd
commit b376a20fb4
3 changed files with 3 additions and 4 deletions

View file

@ -98,7 +98,7 @@ func newMockServer(t *testing.T, code, accessToken string, userinfo []byte) *htt
}) })
require.NoError(t, err) require.NoError(t, err)
}) })
mux.HandleFunc("/oauth2/userinfo", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/oauth2/userinfo", func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
_, err := w.Write(userinfo) _, err := w.Write(userinfo)
require.NoError(t, err) require.NoError(t, err)

View file

@ -60,7 +60,6 @@ func (s *APIV1Service) CreateMemo(ctx context.Context, request *v1pb.CreateMemoR
} }
if len(create.Content) > contentLengthLimit { if len(create.Content) > contentLengthLimit {
return nil, status.Errorf(codes.InvalidArgument, "content too long (max %d characters)", contentLengthLimit) return nil, status.Errorf(codes.InvalidArgument, "content too long (max %d characters)", contentLengthLimit)
} }
property, err := memoproperty.GetMemoPropertyFromContent(create.Content) property, err := memoproperty.GetMemoPropertyFromContent(create.Content)
if err != nil { if err != nil {

View file

@ -9,7 +9,7 @@ import (
"time" "time"
"github.com/google/uuid" "github.com/google/uuid"
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" grpcrecovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware" "github.com/labstack/echo/v4/middleware"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -78,7 +78,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
grpc.MaxRecvMsgSize(100*1024*1024), grpc.MaxRecvMsgSize(100*1024*1024),
grpc.ChainUnaryInterceptor( grpc.ChainUnaryInterceptor(
apiv1.NewLoggerInterceptor().LoggerInterceptor, apiv1.NewLoggerInterceptor().LoggerInterceptor,
grpc_recovery.UnaryServerInterceptor(), grpcrecovery.UnaryServerInterceptor(),
apiv1.NewGRPCAuthInterceptor(store, secret).AuthenticationInterceptor, apiv1.NewGRPCAuthInterceptor(store, secret).AuthenticationInterceptor,
)) ))
s.grpcServer = grpcServer s.grpcServer = grpcServer