This commit is contained in:
Shreyas Goenka 2025-01-29 12:55:58 +01:00
parent ba55f5bb9c
commit 39477d5650
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
1 changed files with 1 additions and 6 deletions

View File

@ -177,13 +177,8 @@ func getTests(t *testing.T) []string {
return testDirs
}
// In case of duplicate keys in env, the last is applicable when spawning a process.
func setEnv(env []string, key, value string) []string {
for i, pair := range env {
if strings.HasPrefix(pair, key+"=") {
env[i] = key + "=" + value
return env
}
}
return append(env, key+"="+value)
}