]> Cypherpunks repositories - gostls13.git/commit
os: restore testErrNotExist's working directory on os.Chdir success
authorGrace Han <hgrace503@gmail.com>
Fri, 9 Apr 2021 05:49:22 +0000 (15:49 +1000)
committerIan Lance Taylor <iant@golang.org>
Mon, 12 Apr 2021 22:19:11 +0000 (22:19 +0000)
commit841bc142160aacde729a983243a0231c8612903d
tree7b67f1566800cde7e0c0d2dad9d42995c6791aba
parent263e13d1f7d2d13782c5a63799c9979b9bbfd853
os: restore testErrNotExist's working directory on os.Chdir success

The existing implementation calls os.Chdir expecting the call not to
succeed. This change restores the original working directory in the
case that the call does succeed.

Fixes #45407

Change-Id: I61c57f6858b9a9058226e45e24276c7af8913048
Reviewed-on: https://go-review.googlesource.com/c/go/+/308849
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/error_test.go