I use gorm for managing my db schema in my application. I need to copy fields from a dto to the model. The id fields are not present in the dto and should not be overriden since it only exists in the destination struct. Why are they set to a zero value? It makes absolutely no sense and should not happen
This does not behave as expected. The ID field of exists gets set to after it's overridden, even if the DTO does not contain any ID fields what so ever. I tried the CopyWithOptions method, none of the options changed the described behaviour what so ever.
Reproducible Example
Description
I use gorm for managing my db schema in my application. I need to copy fields from a dto to the model. The id fields are not present in the dto and should not be overriden since it only exists in the destination struct. Why are they set to a zero value? It makes absolutely no sense and should not happen
This does not behave as expected. The ID field of exists gets set to after it's overridden, even if the DTO does not contain any ID fields what so ever. I tried the CopyWithOptions method, none of the options changed the described behaviour what so ever.