package
Version:
v0.3.0-alpha.1
Opens a new window with list of versions in this module.
Published: May 16, 2026
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package clock provides a mockable time abstraction for deterministic testing.
type Clock interface {
Now() time.Time
}
Clock abstracts time.Now() for testability.
type MockClock struct {
}
MockClock returns a fixed or controlled time for testing.
NewMockClock creates a MockClock starting at the given time.
Add advances the mock clock by the given duration.
Now returns the mock clock's current time.
RealClock uses the real system time.
Now returns the current time.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.