]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: replace os.Setenv with T.Setenv
authorManlio Perillo <manlio.perillo@gmail.com>
Wed, 14 Apr 2021 10:57:21 +0000 (12:57 +0200)
committerIan Lance Taylor <iant@golang.org>
Wed, 14 Apr 2021 19:25:38 +0000 (19:25 +0000)
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>
src/os/exec/lp_unix_test.go

index 75bcdb1fdd95a08ba98acb86292bab16f921ff8d..9fded0eb0af37c501f2133ca8357825835dd3dbc 100644 (file)
@@ -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 {