Now mock logic.
()
| 24 | |
| 25 | // Now mock logic. |
| 26 | func (mock *mockTimer) Now() uint32 { |
| 27 | atomic.AddUint32(&mock.nowCallsCnt, 1) |
| 28 | if mock.nowCallback != nil { |
| 29 | return mock.nowCallback() |
| 30 | } |
| 31 | |
| 32 | return uint32(time.Now().Unix()) |
| 33 | } |
| 34 | |
| 35 | // SetNowCallback sets the callback to be executed inside Now(). |
| 36 | // You can control the return value this way. |