DistinctBy¶
func DistinctBy[T any, K comparable](slice []T, keySelector func(T) K) []T
DistinctBy returns a slice containing only the first occurrence of each element, where uniqueness is determined by the key returned from the keySelector function.
func DistinctBy[T any, K comparable](slice []T, keySelector func(T) K) []T
DistinctBy returns a slice containing only the first occurrence of each element, where uniqueness is determined by the key returned from the keySelector function.