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

Use the current time for NewFakeClock's initial value #55

Merged
merged 1 commit into from
Apr 1, 2023
Merged

Use the current time for NewFakeClock's initial value #55

merged 1 commit into from
Apr 1, 2023

Commits on Apr 1, 2023

  1. Use current time for NewFakeClock's initial value

    This prevents callers from building tests that rely on implementation
    details. Typically by expecting a string containing a static, default
    value of NewFakeClock().
    
    This philosophy of preventing users from relying on implementation
    internals is similar to Go's random map iteration behavior.
    
    For users who depend on the initial clock time, NewFakeClockAt provides
    the behavior they need, and makes their expectations clear in tests.
    DPJacques committed Apr 1, 2023
    2 Configuration menu
    Copy the full SHA
    1dd6ef9 View commit details
    Browse the repository at this point in the history