Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also with transformers: panic: reflect: reflect.flag.mustBeAssignable using unaddressable value #167

Closed
dionysius opened this issue Oct 20, 2020 · 2 comments

Comments

@dionysius
Copy link

dionysius commented Oct 20, 2020

https://play.golang.org/p/gjrJVEVi5ju

I believe this issue has probably the same root cause as #162 #103 #90. I added this issue because I'm experiencing this bug as well when using Transformers.

The transformer in short: it merges a slice of a struct by a matching field name so that in the resulting slice is still unique for that field name, that's why WithAppendSlices is not sufficient for me.

As you can see in the playground, the transformer is perfectly fine in all cases, including "a manual merge recursion", but fails once there is a map[string]<struct> where struct is passed as value. It exact that case the dst reflect.Value CanSet returns false.

@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/imdario/mergo

dionysius added a commit to dionysius/mergo that referenced this issue Oct 20, 2020
dionysius added a commit to dionysius/mergo that referenced this issue Oct 20, 2020
dionysius added a commit to dionysius/mergo that referenced this issue Oct 20, 2020
@darccio
Copy link
Owner

darccio commented Sep 11, 2023

Closing in favour of #162

@darccio darccio closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants