MCPcopy Create free account
hub / github.com/coder/coder / envValue

Function envValue

agent/reconnectingpty/reconnectingpty.go:81–89  ·  view source on GitHub ↗

envValue returns the effective value for name using the last assignment.

(env []string, name string)

Source from the content-addressed store, hash-verified

79
80// envValue returns the effective value for name using the last assignment.
81func envValue(env []string, name string) (string, bool) {
82 prefix := name + "="
83 for i := len(env) - 1; i >= 0; i-- {
84 if value, ok := strings.CutPrefix(env[i], prefix); ok {
85 return value, true
86 }
87 }
88 return "", false
89}
90
91// Options allows configuring the reconnecting pty.
92type Options struct {

Callers 3

effectiveLocaleIsUTF8Function · 0.85
hasNonEmptyEnvFunction · 0.85
TestWithTerminalEnvFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestWithTerminalEnvFunction · 0.68