Documentation ¶
Overview ¶
Package std provides tools for standard types (strings, int, floats, etc).
Index ¶
- func CloneMap[M ~map[K]V, K comparable, V any](m M) M
- func CloneSlice[S ~[]E, E any](s S) S
- func DeepClone[T any](t T) (dst T)
- func ParseCellsDuration(s string) (time.Duration, error)
- func Randkey(n int) string
- func Retry(ctx context.Context, f func() error, seconds ...time.Duration) error
- type Cloneable
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 ParseCellsDuration ¶
ParseCellsDuration wraps standard time.ParseDuration supporting the "d" unit (as day)
Types ¶
Click to show internal directories.
Click to hide internal directories.