samber / mo

🦄 Monads and popular FP abstractions, powered by Go 1.18+ Generics (Option, Result, Either...)
https://pkg.go.dev/github.com/samber/mo
MIT License
2.47k stars 80 forks source link

feat(option): if T is sql.Scanner, use it in Scan() #23

Closed gkdr closed 10 months ago

gkdr commented 1 year ago

When trying to scan JSON columns into a struct, I noticed it fails with an error. This should fix it.

What do you think?

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 62.50% and project coverage change: -0.20 :warning:

Comparison is base (91abb8b) 88.98% compared to head (5d1fc3f) 88.78%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #23 +/- ## ========================================== - Coverage 88.98% 88.78% -0.20% ========================================== Files 13 13 Lines 1080 1088 +8 ========================================== + Hits 961 966 +5 - Misses 107 109 +2 - Partials 12 13 +1 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `88.78% <62.50%> (-0.20%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/samber/mo/pull/23?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe) | Coverage Δ | | |---|---|---| | [option.go](https://codecov.io/gh/samber/mo/pull/23?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe#diff-b3B0aW9uLmdv) | `89.54% <62.50%> (-1.50%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

gkdr commented 1 year ago

Do you have any other concerns or requests?