sirius/model/utils.go
Anatoly Prohacky 666a1a3c12 Начало
2023-04-14 16:01:18 +10:00

20 lines
334 B
Go

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
}