(in interface{})
| 516 | } |
| 517 | |
| 518 | func InterfaceToFloat32Slice(in interface{}) ([]float32, bool) { |
| 519 | if in == nil { |
| 520 | return nil, true |
| 521 | } |
| 522 | |
| 523 | if floatSlice, ok := in.([]float32); ok { |
| 524 | return floatSlice, true |
| 525 | } |
| 526 | |
| 527 | inSlice, ok := InterfaceToInterfaceSlice(in) |
| 528 | if !ok { |
| 529 | return nil, false |
| 530 | } |
| 531 | out := make([]float32, len(inSlice)) |
| 532 | |
| 533 | for i, elem := range inSlice { |
| 534 | casted, ok := InterfaceToFloat32(elem) |
| 535 | if !ok { |
| 536 | return nil, false |
| 537 | } |
| 538 | out[i] = casted |
| 539 | } |
| 540 | return out, true |
| 541 | } |
| 542 | |
| 543 | func InterfaceToFloat64Slice(in interface{}) ([]float64, bool) { |
| 544 | if in == nil { |
no test coverage detected