From 492faaeda8d1d673c4b5d7f3983f3fcd072608de Mon Sep 17 00:00:00 2001 From: Manlio Perillo Date: Wed, 14 Apr 2021 12:57:21 +0200 Subject: [PATCH] os/exec: replace os.Setenv with T.Setenv Updates #45448 Change-Id: I570e9894c4976d0a875388ef9ea4a2aa31b78013 Reviewed-on: https://go-review.googlesource.com/c/go/+/310031 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- src/os/exec/lp_unix_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/os/exec/lp_unix_test.go b/src/os/exec/lp_unix_test.go index 75bcdb1fdd..9fded0eb0a 100644 --- a/src/os/exec/lp_unix_test.go +++ b/src/os/exec/lp_unix_test.go @@ -37,13 +37,7 @@ func TestLookPathUnixEmptyPath(t *testing.T) { t.Fatal("Close failed: ", err) } - pathenv := os.Getenv("PATH") - defer os.Setenv("PATH", pathenv) - - err = os.Setenv("PATH", "") - if err != nil { - t.Fatal("Setenv failed: ", err) - } + t.Setenv("PATH", "") path, err := LookPath("exec_me") if err == nil {