Wednesday 15 January 2014

go - The most concise way to test zero on time.Time -


I have a straight that can not set a time. While testing for time value zero on one of its fields, I can not use zero or 0. time. Unix (0,0) is not even the same. I came up with this: var empty time period. Time if matter Time == Empty time {...}

But I want the solution which saves me a line / temporary variable

Usage ():

  If there is anything. Time. ISGero () {}    

No comments:

Post a Comment