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

Function extractStringList

agent/app/service/agents_utils.go:1478–1493  ·  view source on GitHub ↗
(value interface{})

Source from the content-addressed store, hash-verified

1476}
1477
1478func extractStringList(value interface{}) []string {
1479 switch values := value.(type) {
1480 case []interface{}:
1481 result := make([]string, 0, len(values))
1482 for _, value := range values {
1483 text := strings.TrimSpace(fmt.Sprintf("%v", value))
1484 if text == "" {
1485 continue
1486 }
1487 result = append(result, text)
1488 }
1489 return result
1490 default:
1491 return []string{}
1492 }
1493}
1494
1495func ensureChildMap(parent map[string]interface{}, key string) map[string]interface{} {
1496 if child, ok := parent[key].(map[string]interface{}); ok {

Callers 6

extractFeishuConfigFunction · 0.85
extractTelegramConfigFunction · 0.85
extractDiscordConfigFunction · 0.85
extractQQBotConfigFunction · 0.85
extractWecomConfigFunction · 0.85
extractDingTalkConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected