Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimeEq ¶
func TimeEq(t time.Time) oglematchers.Matcher
Return a matcher for times that are exactly equal to the given input time according to the == operator, which compares on location, instant, and monotonic clock reading.
If you want to ignore location, canonicalize using Time.UTC. If you want to ignore ignore monotonic clock reading, strip it using Time.AddDate(0, 0, 0) (cf. https://goo.gl/rYU5UI).
Types ¶
type SimulatedClock ¶
type SimulatedClock struct { Clock // contains filtered or unexported fields }
A clock that allows for manipulation of the time, which does not change unless AdvanceTime is called. The zero value is a clock initialized to the zero time.
func (*SimulatedClock) AdvanceTime ¶
func (sc *SimulatedClock) AdvanceTime(d time.Duration)
Advance the current time according to the clock by the supplied duration.
func (*SimulatedClock) Now ¶
func (sc *SimulatedClock) Now() time.Time
func (*SimulatedClock) SetTime ¶
func (sc *SimulatedClock) SetTime(t time.Time)
Set the current time according to the clock.
Click to show internal directories.
Click to hide internal directories.