-
Notifications
You must be signed in to change notification settings - Fork 174
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
feat: Add a helper generic function DecodeSliceOfJSON #522
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #522 +/- ##
==========================================
+ Coverage 95.57% 95.60% +0.02%
==========================================
Files 80 80
Lines 33178 33192 +14
==========================================
+ Hits 31710 31732 +22
+ Misses 1267 1260 -7
+ Partials 201 200 -1 ☔ View full report in Codecov by Sentry. |
Sorry @sgasho, I didn't notice that your original version can actually work with both |
var t T | ||
if err = v.DecodeJSON(&t); err != nil { | ||
if IsRedisNil(err) { | ||
continue |
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.
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.
Ah, I see there is a test for this behavior, so probably it is a desired behavior. Sorry for the noise.
added a helper function DecodeSliceOfJSON to struct scan a redis result.
code provided in #521 (comment) did not work so I changed a little.
Related Issue
close #521