Skip to content

Conversation

radeksimko
Copy link
Member

I avoided adding similar check to Compare as the meaning of any integer value there could be misleading, but I believe that the check in Equal is useful e.g. in test cases where nil can appear and equality is checked, either directly, or via library such as https://github.com/google/go-cmp which calls Equal on any struct via reflection.

Such comparisons panic without this patch and therefore don't provide useful output from tests.

@radeksimko radeksimko requested a review from findkim June 17, 2020 16:35
Copy link
Contributor

@findkim findkim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change improves the usability without any undesired/misleading results for the other operators, looks good!

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