MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / parseCommaList

Function parseCommaList

internal/serverapi/usergroup.go:393–406  ·  view source on GitHub ↗

parseCommaList 解析逗号分隔的字符串列表,过滤空元素。

(s string)

Source from the content-addressed store, hash-verified

391
392// parseCommaList 解析逗号分隔的字符串列表,过滤空元素。
393func parseCommaList(s string) []string {
394 if s == "" {
395 return []string{}
396 }
397 parts := strings.Split(s, ",")
398 out := make([]string, 0, len(parts))
399 for _, p := range parts {
400 p = strings.TrimSpace(p)
401 if p != "" {
402 out = append(out, p)
403 }
404 }
405 return out
406}
407
408// writeUserGroupError 根据错误类型返回对应 HTTP 状态码。
409func writeUserGroupError(w http.ResponseWriter, err error) {

Callers 3

handleUserGroupByIDMethod · 0.85
handleGroupMembersMethod · 0.85
handleGroupSyncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected