grafana/pkg/services/user/userimpl/time.go

17 lines
252 B
Go
Raw Normal View History

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
}