Skip to content

Commit 0c2d263

Browse files
authored
fix(transport/grpc/resolver/discovery/resolver.go): remove attributes.Attributes.New() (#2742)
1 parent 78a2089 commit 0c2d263

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

transport/grpc/resolver/discovery/resolver.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,9 @@ func (r *discoveryResolver) Close() {
106106

107107
func (r *discoveryResolver) ResolveNow(options resolver.ResolveNowOptions) {}
108108

109-
func parseAttributes(md map[string]string) *attributes.Attributes {
110-
var a *attributes.Attributes
109+
func parseAttributes(md map[string]string) (a *attributes.Attributes) {
111110
for k, v := range md {
112-
if a == nil {
113-
a = attributes.New(k, v)
114-
} else {
115-
a = a.WithValue(k, v)
116-
}
111+
a = a.WithValue(k, v)
117112
}
118113
return a
119114
}

0 commit comments

Comments
 (0)