Help us shape the future of Go! Take the 2026 Go Developer Survey

clock

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package clock supplies injectable application time. Lifecycle safety deadlines use real context deadlines and are intentionally independent of frozen clocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	// Now returns the current application time.
	Now() time.Time
}

Clock returns the current application time. Consumers pass it explicitly to operations needing deterministic time rather than replacing process globals.

type System

type System struct{}

System reads the operating system clock. Application time has database (microsecond) precision.

func (System) Now

func (System) Now() time.Time

Now returns the current operating system time in UTC, truncated to microsecond precision.

Jump to

Keyboard shortcuts

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