Open uabjabborov opened 2 weeks ago
I think the current behavior is correct: if the source is nil then the destination should also be nil as a result.
If you need to keep the non-nil destination fields then you would need smth like a MapVisitor
but for the structToStruct
function.
It is not implemented yet, contributions are welcome though.
If you decide to implement it then consider adding a generic visitor
option that can be used in both functions: StructToMap
and StructToStruct
The following new test case for
copy.go
is failing. I added it in my local copy.I wonder what the correct behavior should be in this case.