mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-25 10:30:25 +08:00
feat: dbms新增支持工单流程审批
This commit is contained in:
@@ -128,3 +128,18 @@ func ArrayRemoveFunc[T any](arr []T, isDeleteFunc func(T) bool) []T {
|
||||
}
|
||||
return newArr
|
||||
}
|
||||
|
||||
// 数组元素去重
|
||||
func ArrayDeduplicate[T comparable](arr []T) []T {
|
||||
encountered := map[T]bool{}
|
||||
result := []T{}
|
||||
|
||||
for v := range arr {
|
||||
if !encountered[arr[v]] {
|
||||
encountered[arr[v]] = true
|
||||
result = append(result, arr[v])
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user