MCPcopy Index your code
hub / github.com/github/copilot-sdk / getEnvValue

Function getEnvValue

go/client.go:271–279  ·  view source on GitHub ↗

getEnvValue looks up a key in an environment slice ([]string of "KEY=VALUE"). Returns the value if found, or empty string otherwise.

(env []string, key string)

Source from the content-addressed store, hash-verified

269// getEnvValue looks up a key in an environment slice ([]string of "KEY=VALUE").
270// Returns the value if found, or empty string otherwise.
271func getEnvValue(env []string, key string) string {
272 prefix := key + "="
273 for i := len(env) - 1; i >= 0; i-- {
274 if strings.HasPrefix(env[i], prefix) {
275 return env[i][len(prefix):]
276 }
277 }
278 return ""
279}
280
281// setEnvValue returns a copy of env with all existing entries for key removed and
282// a single trailing KEY=VALUE entry added so SDK-managed values win deterministically.

Callers 1

NewClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…