Documentation
¶
Index ¶
- func BodyCut(body []byte, max ...int) string
- func BodySlice(body []byte, limit ...int) string
- func Bytes2String(b []byte) string
- func Cut[T comparable](arr []T, max ...int) []T
- func MapKeys[T comparable, V any](m map[T]V) []T
- func Panic(err error)
- func Slice[T comparable](arr []T, limit ...int) []T
- func String2Bytes(b string) []byte
- func ToMap[T comparable](sl []T) map[T]struct{}
- func UniqSlice[T comparable](list []T) (x []T)
- func ValuesToJson(values url.Values) []byte
- func ValuesToJsonSafe(values url.Values) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes2String ¶
func Cut ¶
func Cut[T comparable](arr []T, max ...int) []T
func MapKeys ¶
func MapKeys[T comparable, V any](m map[T]V) []T
func Slice ¶
func Slice[T comparable](arr []T, limit ...int) []T
Slice
start Optional Zero-based index at which to start extraction, converted to an integer.
Negative index counts back from the end of the array — if start < 0, start + array.length is used. If start < -array.length or start is omitted, 0 is used. If start >= array.length, nothing is extracted.
end Optional Zero-based index at which to end extraction, converted to an integer. slice() extracts up to but not including end.
Negative index counts back from the end of the array — if end < 0, end + array.length is used. If end < -array.length, 0 is used. If end >= array.length or end is omitted, array.length is used, causing all elements until the end to be extracted. If end is positioned before or at start after normalization, nothing is extracted.
func String2Bytes ¶
func ToMap ¶
func ToMap[T comparable](sl []T) map[T]struct{}
func UniqSlice ¶
func UniqSlice[T comparable](list []T) (x []T)
func ValuesToJson ¶
Types ¶
This section is empty.