Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
glebnaz committed Nov 13, 2023
1 parent be86c26 commit 9baf86e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions log/grpc_client_mw.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package log

import (
"context"

"google.golang.org/grpc"
)

Expand Down
3 changes: 2 additions & 1 deletion metrics/grpc_mw_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package metrics

import (
"context"
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/status"
"time"
)

// ClientMetricsUnaryInterceptor returns a new unary client interceptor for
Expand Down
7 changes: 5 additions & 2 deletions trace/client_mw.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package trace

import (
"context"

"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
Expand All @@ -27,6 +28,7 @@ func ClientBaseUnaryInterceptor(from string) grpc.UnaryClientInterceptor {
md, ok := metadata.FromOutgoingContext(ctx)
if ok {
md = metadata.Join(md, metadata.New(map[string]string{string(simpleReqID): reqID}))
ctx = metadata.NewOutgoingContext(ctx, md)
} else {
ctx = metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{string(simpleReqID): reqID}))
}
Expand All @@ -35,14 +37,15 @@ func ClientBaseUnaryInterceptor(from string) grpc.UnaryClientInterceptor {
md, ok := metadata.FromOutgoingContext(ctx)
if ok {
md = metadata.Join(md, metadata.New(map[string]string{string(simpleReqID): reqID}))
ctx = metadata.NewOutgoingContext(ctx, md)
}
ctx = metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{string(simpleReqID): reqID}))
}

md, ok := metadata.FromOutgoingContext(ctx)
if !ok {
md := metadata.New(map[string]string{string(FromKey): from})
ctx = metadata.NewOutgoingContext(ctx, md)
mdNew := metadata.New(map[string]string{string(FromKey): from})
ctx = metadata.NewOutgoingContext(ctx, mdNew)
} else {
md = metadata.Join(md, metadata.New(map[string]string{string(FromKey): from}))
ctx = metadata.NewOutgoingContext(ctx, md)
Expand Down
1 change: 1 addition & 0 deletions trace/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package trace

import (
"context"

"github.com/google/uuid"
"google.golang.org/grpc/metadata"
)
Expand Down

0 comments on commit 9baf86e

Please sign in to comment.