jonboulle / clockwork

a fake clock for golang
Apache License 2.0
631 stars 57 forks source link

clockwork: use non-zero time in NewFakeClock #1

Closed bcwaldon closed 9 years ago

bcwaldon commented 9 years ago

The built-in time package provides a function to check whether or not a given Time object represents Time's zero-value: http://golang.org/pkg/time/#Time.IsZero. The current logic in NewFakeClock returns a time that fulfills IsZero. Users of this library that care about the IsZero distinction will get different results when using the fake clock vs the real clock. Simply using a standard time in the past after time zero gets us a static point in time we can use for comparison.

jonboulle commented 9 years ago

Lgtm