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

fix: driver.Valuer implementation on Option #34

Closed angelbirth closed 5 days ago

angelbirth commented 9 months ago

I encountered a bug where the driver couldn't derive the type of Option[uint32]. Go has driver.DefaultParameterConverter that returns the correct Value, therefore I delegated the Option.Value method to driver.DefaultParameterConverter.ConvertValue

samber commented 9 months ago

Thanks, can you add a unit test please ?

codecov-commenter commented 9 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (77f2b29) 89.15% compared to head (bcdc8e4) 89.15%. Report is 1 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #34 +/- ## ======================================= Coverage 89.15% 89.15% ======================================= Files 13 13 Lines 1125 1125 ======================================= Hits 1003 1003 Misses 109 109 Partials 13 13 ``` | [Flag](https://app.codecov.io/gh/samber/mo/pull/34/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/samber/mo/pull/34/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe) | `89.15% <100.00%> (ø)` | | 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. | [Files](https://app.codecov.io/gh/samber/mo/pull/34?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://app.codecov.io/gh/samber/mo/pull/34?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Samuel+Berthe#diff-b3B0aW9uLmdv) | `89.87% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

angelbirth commented 9 months ago

I will try. Can I use existing tests as reference?

samber commented 5 days ago

Sorry for the delay in my response.

-> v1.13.0