envValue returns the effective value for name using the last assignment.
(env []string, name string)
| 79 | |
| 80 | // envValue returns the effective value for name using the last assignment. |
| 81 | func 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. |
| 92 | type Options struct { |
no outgoing calls