User can be deleted by another user. In that case,
type User struct {
gorm.Model
Email string `gorm:"type:varchar(100)"`
DeletedBy sql.NullInt64
}
DeletedBy will be null when we create a new user. So I used sql.NullInt64 instead of int64. But I cannot convert to JSON.
{ "Email": "xxxxx", "DeletedBy": {"Int64":2,"Valid":true} }
For that, I tried https://gist.github.com/smagch/bc34f861df65c8ea2e90 But Gorm send query condition value as "[{2, true}]"