-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix: Return empty array if no values found #223
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #223 +/- ##
===========================================
+ Coverage 57.90% 57.93% +0.02%
===========================================
Files 99 99
Lines 9571 9582 +11
===========================================
+ Hits 5542 5551 +9
- Misses 3413 3414 +1
- Partials 616 617 +1
|
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.
[]map[string]interface{}{}
is the zero value of a slice which is nil
. It seems a matter of preference as which to choose, and I'd recommend consistency with the rest.
assertQueryResults
wasn't working properly - i.e. not doing the assertion -- for empty values. This fixes it. 👍
There is some difference as test tests failed before I changed the expected values - might be due to Golang wierd (nil)(type) != nil stuff - looking deeper into the prod code, as the transactional results don't seem to care whether the expected is empty or nil |
b7e2942
to
2351fae
Compare
Expected to add quick assert, ended up finding a bug in prod and test code... Code should make a little more sense now. |
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.
LGTM
* Return empty if no values found * Assert nil/empty values are equal * Correctly handle errors in transaction tests
Closes #222
PR includes 3 separate fixes, probably easier to review commit by commit.