Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterNonNil ¶ added in v0.1.26
func FilterNonNil[T Pointer](elems []T) []T
FilterNonNil removes all nil elements from the given slice of elements.
This function assumes that the receiver is not nil and that the receiver is not empty.
Returns:
- []T: The slice of elements with all nils removed.
func MergeEquals ¶ added in v0.1.26
func MergeEquals[T interface { Equals(other T) bool }](elems1, elems2 []T) []T
MergeEquals removes all duplicate elements from the given slices of elements using the Equals method.
Parameters:
- elems1: The first slice of elements.
- elems2: The second slice of elements.
Returns:
- []T: The slice of elements with all duplicates removed.
func UniqueEquals ¶ added in v0.1.26
func UniqueEquals[T interface { Equals(other T) bool }](elems []T) []T
UniqueEquals removes all duplicate elements from the given slice of elements using the Equals method.
Parameters:
- elems: The slice of elements.
Returns:
- []T: The slice of elements with all duplicates removed.
Types ¶
Click to show internal directories.
Click to hide internal directories.