Documentation
¶
Index ¶
- func All[V any](it iter.Seq[V], clb func(V) bool) bool
- func Any2[K, V any](it iter.Seq2[K, V], clb func(K, V) bool) bool
- func Clamp[T cmp.Ordered](val, pMin, pMax T) T
- func Count2[K, V any](it iter.Seq2[K, V]) (out int)
- func Default[T any](v *T, d T) T
- func Deref[T any](v *T) T
- func DoCastF64(v any) float64
- func DoCastStr(v any) string
- func DoParseI64(v string) (out int64)
- func FI64[T Ints](v T) string
- func Find[T any](arr []T, predicate func(T) bool) (out *T)
- func FindIdx[T any](arr []T, predicate func(T) bool) (*T, int)
- func First[T any](a T, _ ...any) T
- 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 Noop(_ ...any)
- func Or[T comparable](a, b T) (zero T)
- 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 RoundThousandth(n float64) float64
- func Second[T any](_ any, a T, _ ...any) T
- 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 Find ¶
Find looks through each value in the list, returning the first one that passes a truth test (predicate), or nil if no value passes the test. The function returns as soon as it finds an acceptable element, and doesn't traverse the entire list
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.