MCPcopy Index your code
hub / github.com/docker/docker-agent / fixedClock

Function fixedClock

pkg/session/clock_test.go:13–15  ·  view source on GitHub ↗

fixedClock returns a clock func that always reports t. Used to make CreatedAt assertions deterministic without touching any global state, so these tests are safe to run in parallel.

(t time.Time)

Source from the content-addressed store, hash-verified

11// CreatedAt assertions deterministic without touching any global state, so
12// these tests are safe to run in parallel.
13func fixedClock(t time.Time) func() time.Time {
14 return func() time.Time { return t }
15}
16
17// stubIDs returns an ID generator that yields the supplied IDs in order and
18// fails the test if exhausted.

Calls

no outgoing calls

Tested by

no test coverage detected