Skip to content

Commit 2c0b57d

Browse files
author
Calvin Lobo
committed
fixed lint errors
1 parent f8ff010 commit 2c0b57d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ecosystem/grpc/client_interceptor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ func ReturnSimpleErrors(registry *Registry) grpc.UnaryClientInterceptor {
3636
grpcCode := codes.Unknown
3737
msg := err.Error()
3838

39-
serr := simplerr.New(msg).
40-
Attr(AttrGRPCMethod, method)
39+
serr := simplerr.New(msg).Attr(AttrGRPCMethod, method) // nolint: govet
4140

4241
// Check if the error is a gRPC status error
4342
// The GRPC framework seems to always return grpc errors on the client side, even if the server does not

ecosystem/grpc/client_interceptor_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func setupServerAndClient(port int) (*PingService, ping.PingServiceClient) {
5151

5252
interceptor := ReturnSimpleErrors(nil)
5353

54-
conn, err := grpc.Dial(fmt.Sprintf(":%d", port),
54+
conn, err := grpc.NewClient(fmt.Sprintf(":%d", port),
5555
grpc.WithUnaryInterceptor(interceptor),
5656
grpc.WithTransportCredentials(insecure.NewCredentials()),
5757
)
@@ -73,7 +73,7 @@ func TestClientInterceptor(t *testing.T) {
7373

7474
st, ok := simplerr.GetAttribute(err, AttrGRPCStatus)
7575
require.True(t, ok)
76-
require.Equal(t, codes.NotFound, st.(*status.Status).Code(), "can get the grpc Status")
76+
require.Equal(t, codes.NotFound, st.(*status.Status).Code(), "can get the grpc Status") // nolint: errcheck
7777

7878
method, ok := simplerr.GetAttribute(err, AttrGRPCMethod)
7979
require.True(t, ok)
@@ -100,7 +100,7 @@ func TestClientInterceptorNotGPRCError(t *testing.T) {
100100

101101
st, ok := simplerr.GetAttribute(err, AttrGRPCStatus)
102102
require.True(t, ok)
103-
require.Equal(t, codes.Unknown, st.(*status.Status).Code(), "can get the grpc Status")
103+
require.Equal(t, codes.Unknown, st.(*status.Status).Code(), "can get the grpc Status") // nolint: errcheck
104104

105105
method, ok := simplerr.GetAttribute(err, AttrGRPCMethod)
106106
require.True(t, ok)

0 commit comments

Comments
 (0)