mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +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
|
@ -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…
Reference in a new issue