README ¶ GoClock A package for mocking time in Go. Documentation Installation go get github.com/bearchit/goclock Usage Please see example/app.go and example/app_test.go Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func WithNow(now time.Time) func(*Mock) type Clock func New() Clock func NewMock(options ...func(*Mock)) Clock type Mock func (c Mock) Now() time.Time func (c *Mock) SetNow(now time.Time) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func WithNow ¶ func WithNow(now time.Time) func(*Mock) Types ¶ type Clock ¶ type Clock interface { Now() time.Time SetNow(now time.Time) } func New ¶ func New() Clock func NewMock ¶ func NewMock(options ...func(*Mock)) Clock type Mock ¶ type Mock struct { // contains filtered or unexported fields } func (Mock) Now ¶ func (c Mock) Now() time.Time func (*Mock) SetNow ¶ func (c *Mock) SetNow(now time.Time) Source Files ¶ View all Source files clock.go Directories ¶ Show internal Expand all Path Synopsis example Click to show internal directories. Click to hide internal directories.