(in interface{})
| 441 | } |
| 442 | |
| 443 | func InterfaceToIntSlice(in interface{}) ([]int, bool) { |
| 444 | if in == nil { |
| 445 | return nil, true |
| 446 | } |
| 447 | |
| 448 | if intSlice, ok := in.([]int); ok { |
| 449 | return intSlice, true |
| 450 | } |
| 451 | |
| 452 | inSlice, ok := InterfaceToInterfaceSlice(in) |
| 453 | if !ok { |
| 454 | return nil, false |
| 455 | } |
| 456 | out := make([]int, len(inSlice)) |
| 457 | |
| 458 | for i, elem := range inSlice { |
| 459 | casted, ok := InterfaceToInt(elem) |
| 460 | if !ok { |
| 461 | return nil, false |
| 462 | } |
| 463 | out[i] = casted |
| 464 | } |
| 465 | return out, true |
| 466 | } |
| 467 | |
| 468 | func InterfaceToInt32Slice(in interface{}) ([]int32, bool) { |
| 469 | if in == nil { |
no test coverage detected