mirror of
https://github.com/unti-io/go-utils.git
synced 2025-10-16 05:10:39 +08:00
v1.3.0
This commit is contained in:
@@ -46,7 +46,7 @@ func ArrayUnique[T any](array []T) (slice []any) {
|
||||
// ArrayEmpty - 数组去空
|
||||
func ArrayEmpty[T any](array []T) (slice []any) {
|
||||
for _, item := range array {
|
||||
if !IsEmpty(item) {
|
||||
if !Is.Empty(item) {
|
||||
slice = append(slice, item)
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func ArrayMapWithField(array []map[string]any, field any) (slice []any) {
|
||||
// 获取字段
|
||||
keys := cast.ToStringSlice(Unity.Keys(field))
|
||||
|
||||
if IsEmpty(keys) {
|
||||
if Is.Empty(keys) {
|
||||
return cast.ToSlice(array)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user