From 27dc0d45dfcb07826f73d884b68ffff8a20d0468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B0=8F=E5=B7=9D?= <1554694323@qq.com> Date: Fri, 5 Mar 2021 19:15:19 +0800 Subject: [PATCH] fix resolver (#740) --- transport/grpc/client.go | 2 +- transport/grpc/resolver/discovery/resolver.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/grpc/client.go b/transport/grpc/client.go index e4959cd9e..c6221a8a6 100644 --- a/transport/grpc/client.go +++ b/transport/grpc/client.go @@ -87,7 +87,7 @@ func dial(ctx context.Context, insecure bool, opts ...ClientOption) (*grpc.Clien grpc.WithUnaryInterceptor(UnaryClientInterceptor(options.middleware)), } if options.discoverer != nil { - grpc.WithResolvers(discovery.NewBuilder(options.discoverer)) + grpcOpts = append(grpcOpts, grpc.WithResolvers(discovery.NewBuilder(options.discoverer))) } if insecure { grpcOpts = append(grpcOpts, grpc.WithInsecure()) diff --git a/transport/grpc/resolver/discovery/resolver.go b/transport/grpc/resolver/discovery/resolver.go index a25f127aa..af0ec5dcb 100644 --- a/transport/grpc/resolver/discovery/resolver.go +++ b/transport/grpc/resolver/discovery/resolver.go @@ -70,5 +70,5 @@ func parseAttributes(md map[string]string) *attributes.Attributes { for k, v := range md { pairs = append(pairs, k, v) } - return attributes.New(pairs) + return attributes.New(pairs...) }