Skip to content

Conversation

@rubensayshi
Copy link
Member

Summary

when using EqualValues for 2 objects which are of the same type and implement an (T) Equal(T) bool method, use the method to compare.

Tbh I'd almost put this in Equal, but EqualValues is more correct...

I chose not to implement supporting EqualValues(Foo{1}, &Foo{1}), though I do have a branch with it implemented ...

Motivation

This seems very much inline with many many other languages and makes it much easier to compare custom types, ranging from application level types to decimal.Decimal.

…mplement an `(T) Equal(T) bool` method, use the method to compare.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants