slicesx

package
v1.0.75 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeduplicateStable

func DeduplicateStable[T comparable](slices ...[]T) []T

DeduplicateStable merges slices into a single slice without duplicates (maintaining order)

func Grow

func Grow[T any](container *[]T, lastIndex int)

Grow assures the given slice has the length to index elements up to the lastIndex (inclusive)

func Map

func Map[T, V any](s []T, op func(T) V) []V

Map functional map of a slice using the op func

func MapTo

func MapTo[T, V any](src []T, dst []V, op func(T) V)

MapTo maps the elements of the source slice to the destination slice using the op func

func NextPowerOfTwo

func NextPowerOfTwo(value int) int

NextPowerOfTwo returns the next power of two for the given value

func PrependValue

func PrependValue[T any](value T, slice []T) []T

PrependValue prepends the given value to the given slice and returns the new slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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