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

Add nil check to Version.Equal #73

Merged
merged 1 commit into from
Jun 17, 2020
Merged

Add nil check to Version.Equal #73

merged 1 commit into from
Jun 17, 2020

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.

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