have to check RowsAffected .
the same as delte
query := db.Model(r).Updates(something) if query.Error != nil { return query.Error } if query.RowsAffected == 0 { return gorm.ErrRecordNotFound }
query := db.Delete(&something{ID: ID}) if query.Error != nil { return query.Error } if query.RowsAffected == 0 { return gorm.ErrRecordNotFound }