mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
17 lines
252 B
Go
17 lines
252 B
Go
|
package userimpl
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
// timeNow wraps time.Now so it can be mocked in tests.
|
||
|
var timeNow = time.Now
|
||
|
|
||
|
func MockTimeNow(constTime time.Time) {
|
||
|
timeNow = func() time.Time {
|
||
|
return constTime
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func ResetTimeNow() {
|
||
|
timeNow = time.Now
|
||
|
}
|