clock

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package clock provides a simple clock type that can be used to get the current time. Its main purpose is to make it easier to test code that depends on the current time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Now

type Now func() time.Time

Now returns the current time.

func Default

func Default() Now

Default returns a new clock that uses time.Now and time.UTC.

func New

func New(loc *time.Location, f Now) Now

New returns a new clock that uses the given location and Now function.

Jump to

Keyboard shortcuts

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