Skip to content

Duration output and input with days and weeks in go

License

Notifications You must be signed in to change notification settings

fortio/duration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc Go Report Card CI Checks codecov

duration

A zero dependency library to overcome issues with lack of days and weeks in standard library's duration as well as ease parsing for common date/times and print durations without zeroes (eg 1d3m instead of 24h3m0s) - it originated in tclock and is available also via dflag for dynamic flag (includes regular duration.Flag for simple flags parsing with new duration in days and weeks).

See the godoc for examples and more details.

See also golang/go#74813

Usage

import fortio.org/duration and go mod tidy, or

go get fortio.org/duration@latest