slices

package
v0.0.0-...-98c81bf Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 3 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 ExpectSlice

func ExpectSlice(v any)

Panic if the argument given is not a slice

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 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 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