Documentation
¶
Overview ¶
Utilities for working with slices
Index ¶
- func DeleteAll[S ~[]E, E comparable](slice S, valueToDelete E) S
- func DeleteFirst[S ~[]E, E comparable](slice S, valueToDelete E) S
- func Map[T any, U any](values []T, fun func(T) U) []U
- func MergeSorted[T cmp.Ordered](a, b []T) []T
- func MergeSortedFunc[T any](a, b []T, compare func(T, T) int) []T
- func Shuffle[S ~[]E, E any](s S)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAll ¶
func DeleteAll[S ~[]E, E comparable](slice S, valueToDelete E) S
Delete all occurrences of valueToDelete in slice
func DeleteFirst ¶
func DeleteFirst[S ~[]E, E comparable](slice S, valueToDelete E) S
Delete the first occurrence of valueToDelete in slice
func MergeSorted ¶
Merge two sorted slices to produce a third sorted slice without duplicates
func MergeSortedFunc ¶
Merge two sorted slices to produce a third sorted slice without duplicates, using the given comparison function
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.