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)
| 1004 | // considers all fields to determine equality. Here, we only consider fields |
| 1005 | // that are meaningful to the subConn. |
| 1006 | func 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 | |
| 1012 | func equalAddressesIgnoringBalAttributes(a, b []resolver.Address) bool { |
| 1013 | return slices.EqualFunc(a, b, func(a, b resolver.Address) bool { return equalAddressIgnoringBalAttributes(&a, &b) }) |
no test coverage detected