16 lines
298 B
Go
16 lines
298 B
Go
package testkit
|
|
|
|
import "time"
|
|
|
|
// FixedClock is a deterministic Clock double that always returns the same
|
|
// instant.
|
|
type FixedClock struct {
|
|
// Time is the instant returned by Now.
|
|
Time time.Time
|
|
}
|
|
|
|
// Now returns the configured instant.
|
|
func (c FixedClock) Now() time.Time {
|
|
return c.Time
|
|
}
|