fix(transport/grpc/resolver/discovery/resolver.go): remove attributes.Attributes.New() (#2742)

pull/2743/merge
jessetang 2 years ago committed by GitHub
parent 78a2089f2b
commit 0c2d2632ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      transport/grpc/resolver/discovery/resolver.go

@ -106,14 +106,9 @@ func (r *discoveryResolver) Close() {
func (r *discoveryResolver) ResolveNow(options resolver.ResolveNowOptions) {} func (r *discoveryResolver) ResolveNow(options resolver.ResolveNowOptions) {}
func parseAttributes(md map[string]string) *attributes.Attributes { func parseAttributes(md map[string]string) (a *attributes.Attributes) {
var a *attributes.Attributes
for k, v := range md { for k, v := range md {
if a == nil { a = a.WithValue(k, v)
a = attributes.New(k, v)
} else {
a = a.WithValue(k, v)
}
} }
return a return a
} }

Loading…
Cancel
Save