format

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package format contains utilities for formatting data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ElemOrDefault added in v0.3.0

func ElemOrDefault[T any](v *T) (t T)

ElemOrDefault returns the element of v or default.

func HumanDuration

func HumanDuration(d time.Duration) string

HumanDuration returns a succinct representation of the provided duration with limited precision for consumption by humans. It provides ~2-3 significant figures of duration.

func Parse

func Parse[T any](s string) (t T, err error)

Parse returns the value of the string representation of u.

func Ptr

func Ptr[T any](v T) *T

Ptr returns the pointer of v.

func String

func String(i any) string

String returns the string representation of u.

Types

This section is empty.

Jump to

Keyboard shortcuts

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