clock

package module
v0.0.0-...-fb1f940 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2014 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now func() time.Time

Now is a variable that holds a function that returns the current time. It can be swapped in runtime.

Functions

func RealNow

func RealNow() time.Time

RealNow returns the real currrent time and is the default value for Now.

Types

type StubClock

type StubClock time.Time

StubClock implements the Clock interface but it always returns the same time when Now() is called. It's most useful for testing.

func (StubClock) Now

func (c StubClock) Now() time.Time

Now always returns the receiver, which is a time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL