clock_test.go 226 B

123456789101112131415
  1. package main
  2. import "time"
  3. type ClockFixed struct {
  4. fix time.Time
  5. }
  6. func (t ClockFixed) Now() time.Time {
  7. return t.fix.In(time.UTC)
  8. }
  9. func (t ClockFixed) After(d time.Duration) <-chan time.Time {
  10. return time.After(d)
  11. }