Documentation ¶
Index ¶
- func Clamp(val, min, max int64) int64
- func DoCastF64(v any) float64
- func DoCastStr(v any) string
- func DoParseI64(v string) (out int64)
- func FI64[T Ints](v T) string
- func GetNbr(doc *goquery.Document, name string) int64
- func GetNbrShips(doc *goquery.Document, name string) int64
- func I64Ptr(v int64) *int64
- func InArr[T comparable](needle T, haystack []T) bool
- func InArray[T Equalable[T]](needle T, haystack []T) bool
- func MaxInt(vals ...int64) int64
- func MinInt(vals ...int64) int64
- func ParseI64(v string) (out int64, err error)
- func ParseInt(val string) int64
- func Ptr[T any](v T) *T
- func RandChoice[T any](arr []T) T
- func RandDuration(min, max time.Duration) time.Duration
- func RandFloat(min, max float64) float64
- func RandMs(min, max int64) time.Duration
- func Random(min, max int64) int64
- func ReadBody(resp *http.Response) (respContent []byte, err error)
- func RoundThousandth(n float64) float64
- func Ternary[T any](predicate bool, a, b T) T
- func TernaryOrZero[T any](predicate bool, a T) T
- func ToInt(buf []byte) (n int)
- type Equalable
- type Ints
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoParseI64 ¶
func InArr ¶
func InArr[T comparable](needle T, haystack []T) bool
func RandChoice ¶
func RandChoice[T any](arr []T) T
RandChoice returns a random element from an array
func RandDuration ¶
RandDuration generates random duration
func RoundThousandth ¶
RoundThousandth round value to the nearest thousandth
func TernaryOrZero ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.