mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 12:08:52 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
This commit is contained in:
commit
107f4c950b
@ -8,9 +8,13 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
_ "embed"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
//go:embed version
|
||||
var Version string
|
||||
|
||||
var (
|
||||
_, b, _, _ = runtime.Caller(0)
|
||||
// Root folder of this project
|
||||
|
1
pkg/common/config/version
Normal file
1
pkg/common/config/version
Normal file
@ -0,0 +1 @@
|
||||
v3.0.0
|
@ -34,7 +34,19 @@ func SliceSubAny[E comparable, T any](a []E, b []T, fn func(t T) E) []E {
|
||||
|
||||
// SliceAnySub a中存在,b中不存在 (a-b) fn 返回的是uuid
|
||||
func SliceAnySub[E any, T comparable](a, b []E, fn func(t E) T) []E {
|
||||
panic("todo")
|
||||
m := make(map[T]E)
|
||||
for i := 0; i < len(b); i++ {
|
||||
v := b[i]
|
||||
m[fn(v)] = v
|
||||
}
|
||||
var es []E
|
||||
for i := 0; i < len(a); i++ {
|
||||
v := a[i]
|
||||
if _, ok := m[fn(v)]; !ok {
|
||||
es = append(es, v)
|
||||
}
|
||||
}
|
||||
return es
|
||||
}
|
||||
|
||||
// DistinctAny 去重
|
||||
|
Loading…
x
Reference in New Issue
Block a user