(val interface{})
| 651 | } |
| 652 | |
| 653 | func toFloat64(val interface{}) (float64, error) { |
| 654 | if val == nil { |
| 655 | return 0, nil |
| 656 | } |
| 657 | |
| 658 | switch v := val.(type) { |
| 659 | case float64: |
| 660 | return v, nil |
| 661 | case int: |
| 662 | return float64(v), nil |
| 663 | case int32: |
| 664 | return float64(v), nil |
| 665 | case int64: |
| 666 | return float64(v), nil |
| 667 | case float32: |
| 668 | return float64(v), nil |
| 669 | default: |
| 670 | return 0, fmt.Errorf("cannot convert %T to float64", val) |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | func toBool(val interface{}) (bool, error) { |
| 675 | if val == nil { |
no outgoing calls
no test coverage detected