mergo icon indicating copy to clipboard operation
mergo copied to clipboard

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

Open dionysius opened this issue 4 years ago • 1 comments

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.

dionysius avatar Oct 20 '20 16:10 dionysius

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

xscode-auto-reply[bot] avatar Oct 20 '20 16:10 xscode-auto-reply[bot]

Closing in favour of #162

darccio avatar Sep 11 '23 13:09 darccio