-
Notifications
You must be signed in to change notification settings - Fork 6
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
Equal operator typed helpers #62
Conversation
6d1c3f0
to
127b2a1
Compare
Codecov Report
@@ Coverage Diff @@
## main #62 +/- ##
==========================================
- Coverage 85.32% 85.31% -0.01%
==========================================
Files 12 13 +1
Lines 1131 1151 +20
==========================================
+ Hits 965 982 +17
- Misses 125 127 +2
- Partials 41 42 +1
Continue to review full report at Codecov.
|
filter/eq.go
Outdated
|
||
// EqUint composes 'equal' operation from uint value. | ||
// Result is equivalent to: field == value | ||
func EqUint(field string, value uint) expr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to support uint
? Let's stick to whatever types we support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's automatically converted to our int32 and back, no need to limit users.
There is no support for Uint64 for example because we don't have enough precision to store it.
filter/eq.go
Outdated
|
||
// EqUint32 composes 'equal' operation from uint32 value. | ||
// Result is equivalent to: field == value | ||
func EqUint32(field string, value uint32) expr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
@@ -29,6 +30,16 @@ const ( | |||
tagSkip = "-" | |||
) | |||
|
|||
// PrimitiveFieldType represents types supported by non-composite fields | |||
type PrimitiveFieldType interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better restrict to our supported types.
5444834
to
98e9fd6
Compare
🎉 This PR is included in version 1.0.0-alpha.9 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.