Your Question
Compare before and after (Dest) values on BeforeUpdate
func (u *User) BeforeUpdate(tx *gorm.DB) (err error) {
if tx.Statement.Changed("Name"){
//u.Name
//tx.Statement.Dest.(User).Name (base on debugger)
}
}
The document you expected this should be explained
https://gorm.io/docs/hooks.html
Expected answer
A way to detect changes in struct's fields. And able to get before and (going to be after)
Comment From: github-actions[bot]
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days