You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As code shown as below, elements in slices aren't merged but appended due to fromType.ConvertibleTo(toType) is false.
In my view the two struct is identical expect for all fields is ptr type, and if you directly copy the struct it's working fine.
Seems like root cause is behavior of isSlice flag and if from.Kind() == reflect.Slice && to.Kind() == reflect.Slice && fromType.ConvertibleTo(toType) branch isn't consistent. But currently I don't know how to fix this. Could you please provide some clarification and help?
As code shown as below, elements in slices aren't merged but appended due to
fromType.ConvertibleTo(toType)
isfalse
.In my view the two struct is identical expect for all fields is
ptr
type, and if you directly copy the struct it's working fine.Seems like root cause is behavior of
isSlice
flag andif from.Kind() == reflect.Slice && to.Kind() == reflect.Slice && fromType.ConvertibleTo(toType)
branch isn't consistent. But currently I don't know how to fix this. Could you please provide some clarification and help?Thx.
Output:
Expected output:
The text was updated successfully, but these errors were encountered: