diff options
author | Manlio Perillo <manlio.perillo@gmail.com> | 2021-04-14 12:57:21 +0200 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-04-14 19:25:38 +0000 |
commit | 492faaeda8d1d673c4b5d7f3983f3fcd072608de (patch) | |
tree | 3c55f8c3980a376b74e8a64e9a11c42357d99e08 /src/os | |
parent | 4df3d0e4df734283911cf3c428d9638c9dc5af4e (diff) | |
download | go-492faaeda8d1d673c4b5d7f3983f3fcd072608de.tar.gz go-492faaeda8d1d673c4b5d7f3983f3fcd072608de.zip |
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 <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/os')
-rw-r--r-- | src/os/exec/lp_unix_test.go | 8 |
1 files changed, 1 insertions, 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 { |