Skip to content

errors in copier.TypeConverters are not returned from the CopyWithOption function and values with error are not applied #158

@valantonini

Description

@valantonini

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions