From: Tobias Klauser Date: Wed, 29 Nov 2017 10:46:48 +0000 (+0100) Subject: os: correct err check in TestChdirAndGetwd X-Git-Tag: go1.10beta1~119 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=06d87bf854ff61c2ea72dec6fc10c4c3fd59a76b;p=gostls13.git os: correct err check in TestChdirAndGetwd Due to err being shadowed in the else brach, the actual err return of fd1.Chdir() is never checked. Fix it by not shadowing err anymore. Change-Id: I9f1d52e88d8bc9a1c035960aa7af9f5224a63ab0 Reviewed-on: https://go-review.googlesource.com/80556 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/os/os_test.go b/src/os/os_test.go index eb8a7d1b92..2d608f4b24 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -1239,9 +1239,9 @@ func TestChdirAndGetwd(t *testing.T) { if mode == 0 { err = Chdir(d) } else { - fd1, err := Open(d) - if err != nil { - t.Errorf("Open %s: %s", d, err) + fd1, err1 := Open(d) + if err1 != nil { + t.Errorf("Open %s: %s", d, err1) continue } err = fd1.Chdir()