fix: resolve golangci-lint errors

- Add periods to end of multi-line comments (godot)
- Omit unused receiver names in methods (revive)
This commit is contained in:
Johnny 2025-12-11 19:37:53 +08:00
parent 06a16fef43
commit c32a79b73b
3 changed files with 9 additions and 9 deletions

View File

@ -49,7 +49,7 @@ func NewGRPCAuthInterceptor(store *store.Store, secret string) *GRPCAuthIntercep
// On successful authentication, context values are set: // On successful authentication, context values are set:
// - auth.UserIDContextKey: The authenticated user's ID // - auth.UserIDContextKey: The authenticated user's ID
// - auth.SessionIDContextKey: Session ID (cookie auth only) // - auth.SessionIDContextKey: Session ID (cookie auth only)
// - auth.AccessTokenContextKey: JWT token (bearer auth only) // - auth.AccessTokenContextKey: JWT token (bearer auth only).
func (in *GRPCAuthInterceptor) AuthenticationInterceptor(ctx context.Context, request any, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) { func (in *GRPCAuthInterceptor) AuthenticationInterceptor(ctx context.Context, request any, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
md, ok := metadata.FromIncomingContext(ctx) md, ok := metadata.FromIncomingContext(ctx)
if !ok { if !ok {

View File

@ -17,7 +17,7 @@ import (
// This wrapper pattern allows us to: // This wrapper pattern allows us to:
// - Reuse existing gRPC service implementations // - Reuse existing gRPC service implementations
// - Support both native gRPC and Connect protocols // - Support both native gRPC and Connect protocols
// - Maintain a single source of truth for business logic // - Maintain a single source of truth for business logic.
type ConnectServiceHandler struct { type ConnectServiceHandler struct {
*APIV1Service *APIV1Service
} }

View File

@ -35,11 +35,11 @@ func (in *LoggingInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFun
} }
} }
func (in *LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc { func (*LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return next // No-op for server-side interceptor return next // No-op for server-side interceptor
} }
func (in *LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc { func (*LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return next // Streaming not used in this service return next // Streaming not used in this service
} }
@ -55,7 +55,7 @@ func (in *LoggingInterceptor) log(procedure string, err error) {
slog.LogAttrs(context.Background(), level, msg, attrs...) slog.LogAttrs(context.Background(), level, msg, attrs...)
} }
func (in *LoggingInterceptor) classifyError(err error) (slog.Level, string) { func (*LoggingInterceptor) classifyError(err error) (slog.Level, string) {
if err == nil { if err == nil {
return slog.LevelInfo, "OK" return slog.LevelInfo, "OK"
} }
@ -106,11 +106,11 @@ func (in *RecoveryInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFu
} }
} }
func (in *RecoveryInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc { func (*RecoveryInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return next return next
} }
func (in *RecoveryInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc { func (*RecoveryInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return next return next
} }
@ -180,11 +180,11 @@ func (in *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
} }
} }
func (in *AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc { func (*AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return next return next
} }
func (in *AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc { func (*AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return next return next
} }