util

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max[T constraints.Ordered](a, b T) T

Max returns the larger of the two provided values. It uses generic type T, which must satisfy the ordered constraints (e.g., integers, floats).

func Min

func Min[T constraints.Ordered](a, b T) T

Min returns the smaller of the two provided values. It uses generic type T, which must satisfy the ordered constraints (e.g., integers, floats).

func RandomInt

func RandomInt(min int, max int) int

RandomInt generates a random integer between the provided min and max integers (inclusive of min, exclusive of max).

func RandomTimeout

func RandomTimeout(min time.Duration, max time.Duration) time.Duration

RandomTimeout generates a random duration between the provided min and max durations.

func RemoveTmpFiles added in v0.1.8

func RemoveTmpFiles(rootDir string) error

RemoveTmpFiles will remove all files in the root directory and its sub-directories with a name that has a 'tmp' prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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