Skip to content

Commit

Permalink
attributes: document that some value types (e.g. maps) must impleme…
Browse files Browse the repository at this point in the history
…nt Equal (#5109)
  • Loading branch information
menghanl authored Jan 6, 2022
1 parent 2fb1ac8 commit 907a202
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion attributes/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 907a202

Please sign in to comment.