TimeStub implements baseservice.TimeGeneratorWithStub to allow time to be stubbed in tests. It exists separately from rivertest.TimeStub to avoid a circular dependency.
| 240 | // |
| 241 | // It exists separately from rivertest.TimeStub to avoid a circular dependency. |
| 242 | type TimeStub struct { |
| 243 | mu sync.RWMutex |
| 244 | now *time.Time |
| 245 | } |
| 246 | |
| 247 | func (t *TimeStub) Now() time.Time { |
| 248 | t.mu.RLock() |
nothing calls this directly
no outgoing calls
no test coverage detected