aro

package
v0.0.0-...-bdec80c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat

func Concat[T any](slices ...[]T) []T

Concatenate the slices given

func Equals

func Equals[T any](a, b T) bool

func ExpectKind

func ExpectKind(v any, expected string)

func ExpectSlice

func ExpectSlice(v any)

Panic if the argument given is not a slice

func Filter

func Filter[F any](filterables []F, criteria func(F) bool) []F

Return a slice of elements that match the criteria given.

func HasKind

func HasKind(v any, expected string) bool

Return true if the kind of the value given equals the expected kind given. Else, false.

func Indexes

func Indexes[T any](slice []T) []int

Return a sequential list of indexes based on the length of the slice given

func IsSlice

func IsSlice(slice any) bool

Return true if the data given is a slice. Else, false.

func ItemType

func ItemType(slice any) reflect.Kind

Return the type of the elements of the slice given

func KindString

func KindString(v any) string

func Prepend

func Prepend[T any](slice []T, item T) []T

Prepend the item given to the slice given

func Remove

func Remove[T any](slice []T, i int) []T

Remove an element from the slice by its index

func RemoveEmpty

func RemoveEmpty[T any](slices [][]T) [][]T

Remove all empty slices from the 2D slice given

func Reverse

func Reverse[T any](slice []T) []T

Reverse the slice given

func Seq

func Seq(min int, max int) []int

func Shift

func Shift[T any](slice []T) []T

Remove the first element from the slice given

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL