Fix option to handle type conversion#49
Conversation
|
This also resolves #24 Edits by maintainers are allowed, in case you want to change something with my comment style. ^.^ Cheers! |
|
Thanks @mtsoltan for your first contribution. Love it! Could you please make it compatible with go < 1.22? You can split it into 3 files:
A build condition can be added at the top of the file using |
|
Check the last commit. I went through great deals of verification to make sure all access patterns of This introduces the debt of maintaining it with this PR, but honestly, given how stable that function is in the standard library of 1.18, I think it's a fair trade in order to achieve a working Let me know what you think. |
| @@ -0,0 +1,22 @@ | |||
| //go:build go1.22 | |||
| // +build go1.22 | |||
There was a problem hiding this comment.
Did not know this syntax before.
It seems that it has been deprecated in go 1.17. So it would be unnecessary in this project (mo supports >= 1.18).
|
-> v1.13.0 |
Conversion doesn't happen automatically when using
mo.Optionto accept from drivers, or inside gorm model structs.The test cases assert the desired behavior, and fail on upstream before this PR, but pass after the changes made.
This supersedes #34, which can now be closed once this is successfully merged.