MCPcopy Index your code
hub / github.com/cli/cli / addParamsMap

Function addParamsMap

pkg/cmd/api/fields.go:122–133  ·  view source on GitHub ↗
(m map[string]interface{}, key string)

Source from the content-addressed store, hash-verified

120}
121
122func 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
135func addParamsSlice(m map[string]interface{}, prevkey, newkey string) (map[string]interface{}, error) {
136 if v, exists := m[prevkey]; exists {

Callers 1

parseFieldsFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected