Skip to content

Commit

Permalink
fixing issue with go imports order and using blank identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
akoserwal committed Sep 2, 2024
1 parent 546c887 commit b65b7e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions transport/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import (
"fmt"
"time"

"github.com/go-kratos/kratos/v2/internal/matcher"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
grpcinsecure "google.golang.org/grpc/credentials/insecure"
grpcmd "google.golang.org/grpc/metadata"

"github.com/go-kratos/kratos/v2/internal/matcher"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/middleware"
"github.com/go-kratos/kratos/v2/registry"
Expand Down
4 changes: 2 additions & 2 deletions transport/grpc/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func GetStream(ctx context.Context) grpc.ServerStream {
}

func (w *wrappedStream) SendMsg(m interface{}) error {
h := func(ctx context.Context, req interface{}) (interface{}, error) {
h := func(_ context.Context, req interface{}) (interface{}, error) {
return req, w.ServerStream.SendMsg(m)
}

Expand All @@ -130,7 +130,7 @@ func (w *wrappedStream) SendMsg(m interface{}) error {
}

func (w *wrappedStream) RecvMsg(m interface{}) error {
h := func(ctx context.Context, req interface{}) (interface{}, error) {
h := func(_ context.Context, req interface{}) (interface{}, error) {
return req, w.ServerStream.RecvMsg(m)
}

Expand Down
5 changes: 2 additions & 3 deletions transport/grpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import (
"testing"
"time"

"google.golang.org/grpc/metadata"

"google.golang.org/grpc"
"google.golang.org/grpc/metadata"

"github.com/go-kratos/kratos/v2/errors"
"github.com/go-kratos/kratos/v2/internal/matcher"
Expand Down Expand Up @@ -337,7 +336,7 @@ func TestServer_streamServerInterceptor(t *testing.T) {
ctx: srv.baseCtx,
}

handler := func(srv interface{}, stream grpc.ServerStream) error {
handler := func(_ interface{}, stream grpc.ServerStream) error {
resp := &testResp{Data: "stream hi"}
return stream.SendMsg(resp)
}
Expand Down

0 comments on commit b65b7e2

Please sign in to comment.