Documentation
¶
Overview ¶
Package lox contains local extensions to the github.com/samber/lo package
Index ¶
- func CRC32(buf []byte) int
- func Chunk[T any](size int, iter iter.Seq[T]) iter.Seq[[]T]
- func Coalesce[T comparable](v ...T) (result T)
- func Elide(s string, maxLen int) string
- func Filter[T any, Slice ~[]T](collection Slice, predicate func(item T) bool) Slice
- func HMACSHA256(key []byte, value []byte) []byte
- func Index[T any](iter iter.Seq[T]) iter.Seq2[int, T]
- func Last[T any](collection []T) T
- func Map[T any, R any](collection []T, iteratee func(item T) R) []R
- func SHA256(buf []byte) []byte
- func SHA512(buf []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chunk ¶
Chunk breaks the elements of iter into chunks of size, returning an iterator over the chunks.
func Coalesce ¶
func Coalesce[T comparable](v ...T) (result T)
Coalesce returns the first non-empty arguments. Arguments must be comparable.
func Elide ¶
Elide returns a string that is at most maxLen characters long. If the string is longer than maxLen, it will be truncated and "..." will be appended to the end. If maxLen is less than 3, it will be set to 3. If the string is shorter than or equal to maxLen, it will be returned
func Filter ¶
Filter iterates over elements of collection, returning an array of all elements predicate returns truthy for. Play: https://go.dev/play/p/Apjg3WeSi7K
func HMACSHA256 ¶
HMACSHA256 returns the HMAC-SHA256 hash of value using key
func Index ¶
Index returns an iterator over the elements of iter, yielding the index and the element.
func Last ¶
func Last[T any](collection []T) T
Last returns the last element of a collection or zero value if empty.
func Map ¶
Map manipulates a slice and transforms it to a slice of another type. Play: https://go.dev/play/p/OkPcYAhBo0D
Types ¶
This section is empty.