mirror of https://github.com/grpc/grpc-go.git
attributes: document that some value types (e.g. `map`s) must implement Equal (#5109)
This commit is contained in:
parent
2fb1ac854b
commit
907a202a61
|
|
@ -69,7 +69,9 @@ func (a *Attributes) Value(key interface{}) interface{} {
|
||||||
// bool' is implemented for a value in the attributes, it is called to
|
// bool' is implemented for a value in the attributes, it is called to
|
||||||
// determine if the value matches the one stored in the other attributes. If
|
// determine if the value matches the one stored in the other attributes. If
|
||||||
// Equal is not implemented, standard equality is used to determine if the two
|
// Equal is not implemented, standard equality is used to determine if the two
|
||||||
// values are equal.
|
// values are equal. Note that some types (e.g. maps) aren't comparable by
|
||||||
|
// default, so they must be wrapped in a struct, or in an alias type, with Equal
|
||||||
|
// defined.
|
||||||
func (a *Attributes) Equal(o *Attributes) bool {
|
func (a *Attributes) Equal(o *Attributes) bool {
|
||||||
if a == nil && o == nil {
|
if a == nil && o == nil {
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue