Skip to content

Conversation

turip
Copy link
Member

@turip turip commented Oct 17, 2025

Overview

This patch adds https://github.com/awalterschulze/goderive for generating equality checks. I would want to have this approach instead of manually writing the equality checks as they are less error prone.

In theory it can also be used to generate the clone methods, however there's a bug with time handling, so that is not something I would do right now: awalterschulze/goderive#91.

Right now we cannot use reflect.deepequals for equality checks as for example alpacadecimal when in fallback mode (e.g. uses the shopspring decimal) uses an exponential representation of the number, for example 8*2^2 (==32). However the library does not normalize the exponent, so it can be also represented as 32*2^0. These values are not deepequal, however the type's Equal member returns the good value.

@turip turip added the release-note/misc Miscellaneous changes label Oct 17, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/use-derive-for-eq-checks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/misc Miscellaneous changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant