(in interface{})
| 669 | } |
| 670 | |
| 671 | func InterfaceToStrInterfaceMap(in interface{}) (map[string]interface{}, bool) { |
| 672 | if in == nil { |
| 673 | return nil, true |
| 674 | } |
| 675 | |
| 676 | if strMap, ok := in.(map[string]interface{}); ok { |
| 677 | return strMap, true |
| 678 | } |
| 679 | |
| 680 | inMap, ok := InterfaceToInterfaceInterfaceMap(in) |
| 681 | if !ok { |
| 682 | return nil, false |
| 683 | } |
| 684 | |
| 685 | out := map[string]interface{}{} |
| 686 | |
| 687 | for key, value := range inMap { |
| 688 | casted, ok := key.(string) |
| 689 | if !ok { |
| 690 | return nil, false |
| 691 | } |
| 692 | out[casted] = value |
| 693 | } |
| 694 | return out, true |
| 695 | } |
| 696 | |
| 697 | // Recursively casts interface->interface maps to string->interface maps |
| 698 | func JSONMarshallable(in interface{}) (interface{}, bool) { |
no test coverage detected