Documentation
¶
Index ¶
- Variables
- func Append(slice any, elements ...any) (any, error)
- func Contains(slice any, value any) bool
- func Extract(input any) ([]any, bool)
- func ExtractArray(input any) ([]any, bool)
- func ExtractSlice(input any) ([]any, bool)
- func Filter(slice any, predicate func(any) bool) (any, error)
- func FromReflect(rv reflect.Value) ([]any, error)
- func IndexOf(slice any, value any) int
- func IsEmpty(input any) bool
- func Join(slice any, separator string) string
- func Length(input any) (int, error)
- func Map(slice any, mapper func(any) any) (any, error)
- func Merge(a, b any) (any, error)
- func Prepend(slice any, elements ...any) (any, error)
- func Reverse(slice any) (any, error)
- func StringToChars(s string) []any
- func ToAny(input any) ([]any, error)
- func ToStrings(input any) ([]string, error)
- func ToTyped[T any](input any) ([]T, error)
- func Unique(slice any) (any, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidReflectValue = errors.New("invalid reflect value") ErrNotSliceArrayOrString = errors.New("input is not a slice, array, or string") ErrCannotConvertSliceElement = errors.New("cannot convert slice element") ErrCannotConvertFirstSlice = errors.New("cannot convert first slice") ErrCannotConvertSecondSlice = errors.New("cannot convert second slice") ErrCannotConvertSlice = errors.New("cannot convert slice") )
Sentinel errors for slicex package.
Functions ¶
func Extract ¶
Extract extracts slice from input, returns the slice and whether extraction was successful
func ExtractArray ¶
ExtractArray extracts array from input, returns the slice and whether extraction was successful
func ExtractSlice ¶
ExtractSlice extracts slice from input, returns the slice and whether extraction was successful
func FromReflect ¶
FromReflect converts reflect.Value to []any
func StringToChars ¶
StringToChars converts a string to []any of characters
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.