From 0c2d2632ac9d2340cbd57078ff0cdd82d534e322 Mon Sep 17 00:00:00 2001 From: jessetang <1430482733@qq.com> Date: Mon, 20 Mar 2023 19:41:45 +0800 Subject: [PATCH] fix(transport/grpc/resolver/discovery/resolver.go): remove attributes.Attributes.New() (#2742) --- transport/grpc/resolver/discovery/resolver.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/transport/grpc/resolver/discovery/resolver.go b/transport/grpc/resolver/discovery/resolver.go index a4bd05d5b..c50c65cbd 100644 --- a/transport/grpc/resolver/discovery/resolver.go +++ b/transport/grpc/resolver/discovery/resolver.go @@ -106,14 +106,9 @@ func (r *discoveryResolver) Close() { func (r *discoveryResolver) ResolveNow(options resolver.ResolveNowOptions) {} -func parseAttributes(md map[string]string) *attributes.Attributes { - var a *attributes.Attributes +func parseAttributes(md map[string]string) (a *attributes.Attributes) { for k, v := range md { - if a == nil { - a = attributes.New(k, v) - } else { - a = a.WithValue(k, v) - } + a = a.WithValue(k, v) } return a }