std

package
v4.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package std provides tools for standard types (strings, int, floats, etc).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneMap added in v4.0.4

func CloneMap[M ~map[K]V, K comparable, V any](m M) M

Clone returns a copy of m. This is a shallow clone: the new keys and values are set using ordinary assignment.

func CloneSlice added in v4.2.2

func CloneSlice[S ~[]E, E any](s S) S

Clone returns a copy of the slice. The elements are copied using assignment, so this is a shallow clone.

func DeepClone added in v4.2.2

func DeepClone[T any](t T) (dst T)

func ParseCellsDuration

func ParseCellsDuration(s string) (time.Duration, error)

ParseCellsDuration wraps standard time.ParseDuration supporting the "d" unit (as day)

func Randkey

func Randkey(n int) string

Randkey produces a random string with a given length

func Retry

func Retry(ctx context.Context, f func() error, seconds ...time.Duration) error

Retry function

Types

type Cloneable added in v4.2.2

type Cloneable interface {
	Clone() interface{}
}

Jump to

Keyboard shortcuts

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