| 120 | } |
| 121 | |
| 122 | func addParamsMap(m map[string]interface{}, key string) (map[string]interface{}, error) { |
| 123 | if v, exists := m[key]; exists { |
| 124 | if existMap, ok := v.(map[string]interface{}); ok { |
| 125 | return existMap, nil |
| 126 | } else { |
| 127 | return nil, fmt.Errorf("expected map type under %q, got %T", key, v) |
| 128 | } |
| 129 | } |
| 130 | newMap := make(map[string]interface{}) |
| 131 | m[key] = newMap |
| 132 | return newMap, nil |
| 133 | } |
| 134 | |
| 135 | func addParamsSlice(m map[string]interface{}, prevkey, newkey string) (map[string]interface{}, error) { |
| 136 | if v, exists := m[prevkey]; exists { |