fetchEnvironmentInternal should only be called from fetchEnvironment or ResetEnvironment, who will hold the required lock.
()
| 210 | // fetchEnvironmentInternal should only be called from fetchEnvironment or |
| 211 | // ResetEnvironment, who will hold the required lock. |
| 212 | func fetchEnvironmentInternal() []string { |
| 213 | if env != nil { |
| 214 | return env |
| 215 | } |
| 216 | |
| 217 | realEnv := os.Environ() |
| 218 | env = make([]string, 0, len(realEnv)) |
| 219 | |
| 220 | for _, kv := range realEnv { |
| 221 | if strings.HasPrefix(kv, traceEnv) || strings.HasPrefix(kv, superPrefixEnv) { |
| 222 | continue |
| 223 | } |
| 224 | env = append(env, kv) |
| 225 | } |
| 226 | return env |
| 227 | } |
| 228 | |
| 229 | // ResetEnvironment resets the cached environment that's used in subprocess |
| 230 | // calls. |
no outgoing calls
no test coverage detected