MCPcopy Index your code
hub / github.com/go-task/task / GetTaskEnvStringSlice

Function GetTaskEnvStringSlice

internal/env/env.go:109–125  ·  view source on GitHub ↗

GetTaskEnvStringSlice returns a comma-separated list from a TASK_ prefixed env var. Returns the slice and true if set (non-empty), or nil and false if not set.

(key string)

Source from the content-addressed store, hash-verified

107// GetTaskEnvStringSlice returns a comma-separated list from a TASK_ prefixed env var.
108// Returns the slice and true if set (non-empty), or nil and false if not set.
109func GetTaskEnvStringSlice(key string) ([]string, bool) {
110 v := GetTaskEnv(key)
111 if v == "" {
112 return nil, false
113 }
114 parts := strings.Split(v, ",")
115 result := make([]string, 0, len(parts))
116 for _, p := range parts {
117 if trimmed := strings.TrimSpace(p); trimmed != "" {
118 result = append(result, trimmed)
119 }
120 }
121 if len(result) == 0 {
122 return nil, false
123 }
124 return result, true
125}

Callers 1

getEnvAsFunction · 0.92

Calls 1

GetTaskEnvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…