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
Current Time structure has no method like IsNull() (Valid() or something else) so you need to use t.Equal(time.Time{}) or pointers to check is time defined or not (for example, when you aquire values from external sources and some of them may be omited). Usage of pointers for such small object has known overhead, so I propose to add function IsNull() which returns true for uninitialized time structure (1970-01-01 00:00:00).
The text was updated successfully, but these errors were encountered:
The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC. As this time is unlikely to come up in practice, the IsZero method gives a simple way of detecting a time that has not been initialized explicitly.
Current Time structure has no method like IsNull() (Valid() or something else) so you need to use
t.Equal(time.Time{})
or pointers to check is time defined or not (for example, when you aquire values from external sources and some of them may be omited). Usage of pointers for such small object has known overhead, so I propose to add function IsNull() which returns true for uninitialized time structure (1970-01-01 00:00:00).The text was updated successfully, but these errors were encountered: