format

package
v0.0.0-...-63c3a42 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package format provides convenience functions for formatting.

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeFormatSeconds    string = "02 Jan 2006 15:04:05 MST"
	TimeFormatSubseconds string = "02 Jan 2006 15:04:05.99 MST"
)

Functions

func Duration

func Duration(duration time.Duration) string

Duration is similar to the time.Duration.String method from the standard library but is more readable and shows only 3 digits of precision when duration is less than 1 minute.

func FormatBytes

func FormatBytes(bytes uint64) string

FormatBytes returns a string with the number of bytes specified converted into a human-friendly format with a binary multiplier (i.e. GiB).

Types

This section is empty.

Jump to

Keyboard shortcuts

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