MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / splitCommaEnv

Function splitCommaEnv

api/pkg/di/config.go:28–38  ·  view source on GitHub ↗
(key, defaultValue string)

Source from the content-addressed store, hash-verified

26}
27
28func splitCommaEnv(key, defaultValue string) []string {
29 value := getEnvWithDefault(key, defaultValue)
30 parts := strings.Split(value, ",")
31 result := make([]string, 0, len(parts))
32 for _, part := range parts {
33 if trimmed := strings.TrimSpace(part); trimmed != "" {
34 result = append(result, trimmed)
35 }
36 }
37 return result
38}

Callers 1

AppMethod · 0.85

Calls 1

getEnvWithDefaultFunction · 0.85

Tested by

no test coverage detected