blob: 8a4b0f9f8d31e7c6c56c6fd6c72f31fca4dd54cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package log
import (
"time"
)
// Clock interface provides the time
type clock interface {
Now() time.Time
}
// realClock is the default time implementation
type realClock struct{}
// Now returns the time
func (realClock) Now() time.Time { return time.Now() }
// stubClock is the default time implementation
type stubClock struct {
StubTime time.Time
}
// Now returns a stub time
func (c *stubClock) Now() time.Time { return c.StubTime }
|