Documentation
¶
Index ¶
- func CountBetweenTimes(t1, t2 time.Time, interval time.Duration) int64
- func ElapsedTime(callback func() error) (time.Duration, error)
- func FromReferenceOrDefault[T any](t *T) T
- func GoVersion() string
- func MapToList[T1 comparable, T2 any](m map[T1]T2) []T2
- func Must[T any](a T, err error) T
- func Round(num float64, precision int) float64
- func RoundDownTime(t time.Time, interval time.Duration) time.Time
- func TemporaryEnvVar(key, value string) (reset func())
- func ToReference[T any](t T) *T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountBetweenTimes ¶
CountBetweenTimes will return the number of interval between two times rounded down to the given interval
func FromReferenceOrDefault ¶
func FromReferenceOrDefault[T any](t *T) T
FromReferenceOrDefault return the value from the reference or the default value from the type is the reference is nil
func GoVersion ¶
func GoVersion() string
GoVersion returns the go version used to compile the library
func MapToList ¶
func MapToList[T1 comparable, T2 any](m map[T1]T2) []T2
MapToList will change a map to a list.
func TemporaryEnvVar ¶
func TemporaryEnvVar(key, value string) (reset func())
func ToReference ¶
func ToReference[T any](t T) *T
ToReference return the value in argument as a reference
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.