slice

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectChunks

func CollectChunks[T any](it iter.Seq[T], n int) iter.Seq[[]T]

CollectChunks collects chunks of n elements from the input sequence and return a Seq of chunks

func Group

func Group[T any, K comparable](s []T, keyFunc func(T) K) map[K][]T

func Insert

func Insert[T any](slice []T, value T, index int) []T

func Map

func Map[T any, R any](t []T, mapFunc func(T) R) []R

func MapWithArg

func MapWithArg[I any, O any, A any](t []I, arg A, mapFunc func(A, I) O) []O

func Remove

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

func SeqFunc

func SeqFunc[I, O any](s []I, f func(I) O) iter.Seq[O]

SeqFunc returns a Seq that iterates over the slice with the given mapping function

func ToMap

func ToMap[T any, K comparable, V any](s []T, transformFunc func(T) (K, V)) map[K]V

func Unique

func Unique[T comparable](list []T) []T

Types

This section is empty.

Jump to

Keyboard shortcuts

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