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

Make find many operations return empty slice instead of nil #40

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

sunboyy
Copy link
Owner

@sunboyy sunboyy commented Jan 14, 2024

Previously, find many operations return nil when there is no data that matches the query. This leads to null when the result is encoded into other formats like JSON, which is inconsistent. This MR fixes that by returning an empty slice instead of nil value.

@sunboyy sunboyy added the bug Something isn't working label Jan 14, 2024
@sunboyy sunboyy self-assigned this Jan 14, 2024
Copy link

codecov bot commented Jan 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (97619d4) 97.39% compared to head (b736b94) 97.39%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #40   +/-   ##
=======================================
  Coverage   97.39%   97.39%           
=======================================
  Files          27       27           
  Lines        1341     1345    +4     
=======================================
+ Hits         1306     1310    +4     
  Misses         20       20           
  Partials       15       15           
Flag Coverage Δ
unittests 97.39% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sunboyy sunboyy force-pushed the find-many-empty-slice branch from a4ca61b to b736b94 Compare January 14, 2024 05:05
@sunboyy sunboyy merged commit 35eb7a9 into main Jan 14, 2024
5 checks passed
@sunboyy sunboyy deleted the find-many-empty-slice branch January 14, 2024 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant