array

package
v0.65.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToSet

func AppendToSet[I comparable](sets ...map[I]struct{}) map[I]struct{}

func ArrayToChannel

func ArrayToChannel[I any](array []I) chan I

func ChannelToArray

func ChannelToArray[I any](c chan I) []I

func Intersection

func Intersection[T comparable](a, b []T) []T

func Keys

func Keys[I comparable, A any](m map[I]A) []I

func Map

func Map[I any, O any](inputSlice []I, mapFn func(*I) O) []O

func RemoveElementsFromArray

func RemoveElementsFromArray[T any](indicesToRemove []int, array *[]T) error

func SetDiff

func SetDiff[I comparable](setA map[I]struct{}, setB map[I]struct{}) map[I]struct{}

func SetSliceIntersection

func SetSliceIntersection[T comparable](a map[T]struct{}, b []T) []T

func SetToSlice

func SetToSlice[I comparable](set map[I]struct{}) []I

func SliceDiff

func SliceDiff[T comparable](a, b []T) []T

SliceDiff returns the difference between the two slices. It returns the elements that appear in a but not in b

func SliceFullDiff

func SliceFullDiff(a, b []string) ([]string, []string)

SliceFullDiff returns the full difference between the two slices. The first return value are the elements that were added (in b but not in a), the second are the elements that were removed (in a but not in b)

func SliceSetDiff

func SliceSetDiff[T comparable](a []T, b map[T]struct{}) []T

func SliceToSet

func SliceToSet[I comparable](slice []I) map[I]struct{}

func SplitIntoBucketsOfSize

func SplitIntoBucketsOfSize[T any](bucketSize int, array []T) [][]T

func Values

func Values[I comparable, A any](m map[I]A) []A

Types

This section is empty.

Jump to

Keyboard shortcuts

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