Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prvbl] impl EqualValues 2 objects have (T) Equal(T) bool #1

Open
wants to merge 1 commit into
base: prvbl
Choose a base branch
from

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.

1 participant