MCPcopy
hub / github.com/grpc/grpc-go / equalAddressIgnoringBalAttributes

Function equalAddressIgnoringBalAttributes

clientconn.go:1006–1010  ·  view source on GitHub ↗

equalAddressIgnoringBalAttributes returns true is a and b are considered equal. This is different from the Equal method on the resolver.Address type which considers all fields to determine equality. Here, we only consider fields that are meaningful to the subConn.

(a, b *resolver.Address)

Source from the content-addressed store, hash-verified

1004// considers all fields to determine equality. Here, we only consider fields
1005// that are meaningful to the subConn.
1006func equalAddressIgnoringBalAttributes(a, b *resolver.Address) bool {
1007 return a.Addr == b.Addr && a.ServerName == b.ServerName &&
1008 a.Attributes.Equal(b.Attributes) &&
1009 a.Metadata == b.Metadata
1010}
1011
1012func equalAddressesIgnoringBalAttributes(a, b []resolver.Address) bool {
1013 return slices.EqualFunc(a, b, func(a, b resolver.Address) bool { return equalAddressIgnoringBalAttributes(&a, &b) })

Callers 2

updateAddrsMethod · 0.70

Calls 1

EqualMethod · 0.65

Tested by

no test coverage detected