Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clockwork: use non-zero time in NewFakeClock #1

Merged
merged 1 commit into from
Dec 16, 2014

Conversation

bcwaldon
Copy link
Contributor

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
Copy link
Owner

Lgtm

jonboulle added a commit that referenced this pull request Dec 16, 2014
clockwork: use non-zero time in NewFakeClock
@jonboulle jonboulle merged commit 3f831b6 into jonboulle:master Dec 16, 2014
@bcwaldon bcwaldon deleted the fake-nonzero branch December 16, 2014 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants