mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 23:32:47 +01:00
20 lines
245 B
Go
Executable File
20 lines
245 B
Go
Executable File
package time
|
|
|
|
import "time"
|
|
|
|
type Clock interface {
|
|
Now() time.Time
|
|
}
|
|
|
|
type realClock struct{}
|
|
|
|
func (realClock) Now() time.Time {
|
|
return time.Now()
|
|
}
|
|
|
|
var DefaultClock Clock = &realClock{}
|
|
|
|
func Now() time.Time {
|
|
return DefaultClock.Now()
|
|
}
|