envOnce looks up an environment variable (optionally by multiple names) once. It mitigates expensive lookups on some platforms (e.g. Windows). (Borrowed from net/http/transport.go)
| 251 | // (e.g. Windows). |
| 252 | // (Borrowed from net/http/transport.go) |
| 253 | type proxy_envOnce struct { |
| 254 | names []string |
| 255 | once sync.Once |
| 256 | val string |
| 257 | } |
| 258 | |
| 259 | func (e *proxy_envOnce) Get() string { |
| 260 | e.once.Do(e.init) |
nothing calls this directly
no outgoing calls
no test coverage detected