MCPcopy Index your code
hub / github.com/github/github-mcp-server / ParseCommaSeparated

Function ParseCommaSeparated

pkg/http/headers/parse.go:7–21  ·  view source on GitHub ↗

ParseCommaSeparated splits a header value by comma, trims whitespace, and filters out empty values

(value string)

Source from the content-addressed store, hash-verified

5// ParseCommaSeparated splits a header value by comma, trims whitespace,
6// and filters out empty values
7func ParseCommaSeparated(value string) []string {
8 if value == "" {
9 return []string{}
10 }
11
12 parts := strings.Split(value, ",")
13 result := make([]string, 0, len(parts))
14 for _, p := range parts {
15 trimmed := strings.TrimSpace(p)
16 if trimmed != "" {
17 result = append(result, trimmed)
18 }
19 }
20 return result
21}

Callers 2

WithRequestConfigFunction · 0.92
TestParseCommaSeparatedFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestParseCommaSeparatedFunction · 0.68