MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / ensureChildMap

Function ensureChildMap

agent/app/service/agents_utils.go:1495–1502  ·  view source on GitHub ↗
(parent map[string]interface{}, key string)

Source from the content-addressed store, hash-verified

1493}
1494
1495func ensureChildMap(parent map[string]interface{}, key string) map[string]interface{} {
1496 if child, ok := parent[key].(map[string]interface{}); ok {
1497 return child
1498 }
1499 child := map[string]interface{}{}
1500 parent[key] = child
1501 return child
1502}
1503
1504func structToMap(value interface{}) (map[string]interface{}, error) {
1505 payload, err := json.Marshal(value)

Calls

no outgoing calls

Tested by

no test coverage detected