Skip to content

Commit 907a202

Browse files
authored
attributes: document that some value types (e.g. maps) must implement Equal (#5109)
1 parent 2fb1ac8 commit 907a202

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

attributes/attributes.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ func (a *Attributes) Value(key interface{}) interface{} {
6969
// bool' is implemented for a value in the attributes, it is called to
7070
// determine if the value matches the one stored in the other attributes. If
7171
// Equal is not implemented, standard equality is used to determine if the two
72-
// values are equal.
72+
// values are equal. Note that some types (e.g. maps) aren't comparable by
73+
// default, so they must be wrapped in a struct, or in an alias type, with Equal
74+
// defined.
7375
func (a *Attributes) Equal(o *Attributes) bool {
7476
if a == nil && o == nil {
7577
return true

0 commit comments

Comments
 (0)