From 907a202a615d3b2de857e4302cf6032004d65aee Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 6 Jan 2022 15:44:56 -0800 Subject: [PATCH] attributes: document that some value types (e.g. `map`s) must implement Equal (#5109) --- attributes/attributes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/attributes/attributes.go b/attributes/attributes.go index 6ff2792ee..ae13ddac1 100644 --- a/attributes/attributes.go +++ b/attributes/attributes.go @@ -69,7 +69,9 @@ func (a *Attributes) Value(key interface{}) interface{} { // 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 // 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 { if a == nil && o == nil { return true