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 }