1
0
mirror of https://github.com/golang/go synced 2024-10-01 20:28:33 -06:00

cmd/go: avoid creating new empty environment variables

Broke some tests that assume $GORACE is unset (because it never is).
Those tests are arguably wrong, but this is more robust.

Change-Id: Id56daa160c9e7e01f301c1386791e410bbd5deef
Reviewed-on: https://go-review.googlesource.com/6480
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Russ Cox 2015-03-02 13:49:57 -05:00
parent bfb8ad51d5
commit 8012a2e9c9

View File

@ -158,7 +158,9 @@ func main() {
// but in practice there might be skew
// This makes sure we all agree.
for _, env := range mkEnv() {
os.Setenv(env.name, env.value)
if os.Getenv(env.name) != env.value {
os.Setenv(env.name, env.value)
}
}
for _, cmd := range commands {