This commit is contained in:
withchao
2023-02-22 11:20:09 +08:00
parent 62a2cf2976
commit e94bf6216c
3 changed files with 13 additions and 3 deletions
+5
View File
@@ -32,6 +32,11 @@ func SliceSubAny[E comparable, T any](a []E, b []T, fn func(t T) E) []E {
return SliceSub(a, Slice(b, fn))
}
// SliceAnySub a中存在,b中不存在 (a-b) fn 返回的是uuid
func SliceAnySub[E any, T comparable](a, b []E, fn func(t E) T) []E {
panic("todo")
}
// DistinctAny 去重
func DistinctAny[E any, K comparable](es []E, fn func(e E) K) []E {
v := make([]E, 0, len(es))