(in interface{})
| 541 | } |
| 542 | |
| 543 | func InterfaceToFloat64Slice(in interface{}) ([]float64, bool) { |
| 544 | if in == nil { |
| 545 | return nil, true |
| 546 | } |
| 547 | |
| 548 | if floatSlice, ok := in.([]float64); ok { |
| 549 | return floatSlice, true |
| 550 | } |
| 551 | |
| 552 | inSlice, ok := InterfaceToInterfaceSlice(in) |
| 553 | if !ok { |
| 554 | return nil, false |
| 555 | } |
| 556 | out := make([]float64, len(inSlice)) |
| 557 | |
| 558 | for i, elem := range inSlice { |
| 559 | casted, ok := InterfaceToFloat64(elem) |
| 560 | if !ok { |
| 561 | return nil, false |
| 562 | } |
| 563 | out[i] = casted |
| 564 | } |
| 565 | return out, true |
| 566 | } |
| 567 | |
| 568 | func InterfaceToStrSlice(in interface{}) ([]string, bool) { |
| 569 | if in == nil { |
no test coverage detected