The time zero is time.Time{}
, and you can check that it's zero with time.IsZero(t)
. So, something like:
user.ResetSent = time.Time{}
If you need it to really omitempty
, you could use a *time.Time
, so it will leave it empty if nil.
Update:
Gustavo's comment is correct, omitempty
works as intended for zero-valued time, without a pointer.