mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
4df3d0e4df
commit
492faaeda8
1 changed files with 1 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue