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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: