darccio/mergo

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

dionysius opened this issue · 2 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.

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

Closing in favour of #162