v0.0.186 convert array to interface arr

This commit is contained in:
2023-07-24 09:13:19 +02:00
parent 0971f60c30
commit e909d656d9
3 changed files with 21 additions and 2 deletions

View File

@@ -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
}