copier
copier copied to clipboard
errors in copier.TypeConverters are not returned from the CopyWithOption function and values with error are not applied
Reproducible Example
https://go.dev/play/p/lrlMEMSFKZ_N
Description
If an error is returned in a copier.TypeConverter
, the copier.CopyWithOption
returns nil for the error and the value is not applied to the destination.
In the Go Playground example above, the custom converter returns an error as well as the value "invalid".
I would expect copier.CopyWithOption to return the error and for dest.Val to be "invalid".
We are happy to work on the fix if this is indeed an issue.
fixed. let error will raise up if the error is happening.
If I understand correctly you are aiming at returning an error message if the source and destinations types are not a match and not convertible?