From b3a60ba4f1bf82834cb6b6123bbb230ff85d8b05 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 3 Dec 2019 22:59:44 +0300 Subject: [PATCH] linting fixes Signed-off-by: Vasiliy Tolstov --- codec.go | 10 ---------- grpc.go | 10 ---------- grpc_pool_test.go | 2 +- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/codec.go b/codec.go index c792abb..2f32a0b 100644 --- a/codec.go +++ b/codec.go @@ -11,8 +11,6 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/micro/go-micro/codec" "github.com/micro/go-micro/codec/bytes" - "github.com/micro/go-micro/codec/jsonrpc" - "github.com/micro/go-micro/codec/protorpc" "google.golang.org/grpc" "google.golang.org/grpc/encoding" ) @@ -36,14 +34,6 @@ var ( "application/grpc+bytes": bytesCodec{}, } - defaultRPCCodecs = map[string]codec.NewCodec{ - "application/json": jsonrpc.NewCodec, - "application/json-rpc": jsonrpc.NewCodec, - "application/protobuf": protorpc.NewCodec, - "application/proto-rpc": protorpc.NewCodec, - "application/octet-stream": protorpc.NewCodec, - } - json = jsoniter.ConfigCompatibleWithStandardLibrary ) diff --git a/grpc.go b/grpc.go index 62b8d5d..a593b69 100644 --- a/grpc.go +++ b/grpc.go @@ -282,16 +282,6 @@ func (g *grpcClient) newGRPCCodec(contentType string) (encoding.Codec, error) { return nil, fmt.Errorf("Unsupported Content-Type: %s", contentType) } -func (g *grpcClient) newCodec(contentType string) (codec.NewCodec, error) { - if c, ok := g.opts.Codecs[contentType]; ok { - return c, nil - } - if cf, ok := defaultRPCCodecs[contentType]; ok { - return cf, nil - } - return nil, fmt.Errorf("Unsupported Content-Type: %s", contentType) -} - func (g *grpcClient) Init(opts ...client.Option) error { size := g.opts.PoolSize ttl := g.opts.PoolTTL diff --git a/grpc_pool_test.go b/grpc_pool_test.go index 955e18c..d5c1fdb 100644 --- a/grpc_pool_test.go +++ b/grpc_pool_test.go @@ -1,11 +1,11 @@ package grpc import ( + "context" "net" "testing" "time" - "context" "google.golang.org/grpc" pgrpc "google.golang.org/grpc" pb "google.golang.org/grpc/examples/helloworld/helloworld"