v0.0.186 convert array to interface arr
This commit is contained in:
@@ -459,3 +459,11 @@ func ArrExcept[T comparable](arr []T, needles ...T) []T {
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func ArrayToInterface[T any](t []T) []interface{} {
|
||||
res := make([]interface{}, 0, len(t))
|
||||
for i, _ := range t {
|
||||
res = append(res, t[i])
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
Reference in New Issue
Block a user