You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/sliceutil/README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ All functions in this package are pure: they never modify their input. They are
18
18
|`FilterMapKeys`|`func[K comparable, V any](m map[K]V, predicate func(K, V) bool) []K`| Returns map keys for which `predicate(key, value)` is `true`; order is not guaranteed |
19
19
|`Any`|`func[T any](slice []T, predicate func(T) bool) bool`| Returns `true` if at least one element satisfies `predicate`; returns `false` for nil or empty slices |
20
20
|`Deduplicate`|`func[T comparable](slice []T) []T`| Returns a new slice with duplicate elements removed, preserving order of first occurrence |
21
+
|`MergeUnique`|`func[T comparable](base []T, extra ...T) []T`| Returns a deduplicated slice starting with `base` and appending unseen values from `extra`|
22
+
|`Exclude`|`func[T comparable](base []T, exclude ...T) []T`| Returns a new slice with all `exclude` values removed while preserving order |
0 commit comments