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
In documentation Update function not get arguments as filled struct object. The arg of function look like as creating new struct object which values set on create.
// Update multiple fieldserr:=db.Update(&User{ID: 10, Name: "Jack", Age: 45})
// Update a single fielderr:=db.UpdateField(&User{ID: 10}, "Age", 0)
If I understand things correctly, calling
db.Save(&data)
will alter the record in the database, and&data
will contain the updated version.On the other hand, if I call
db.Update(&data)
, the non-zero fields gets updated in the database but&data
won't reflect the state of the database.Am I missing something? Is it on purpose?
The text was updated successfully, but these errors were encountered: