sirius/model/utils.go

20 lines
334 B
Go
Raw Normal View History

2023-04-14 09:01:18 +03:00
package model
func InterToArray(inp []interface{}) ([]int64, []bool, []string) {
var i []int64
var b []bool
var s []string
for _, v1 := range inp {
switch v2 := v1.(type) {
case float64:
i = append(i, int64(v2))
case bool:
b = append(b, bool(v2))
case string:
s = append(s, string(v2))
}
}
return i, b, s
}