-
Notifications
You must be signed in to change notification settings - Fork 18k
path/filepath: simplify chdir and error handling in tests #64463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR (HEAD: 9648054) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/546217. Important tips:
|
This change simplifies the test code for changing directories by utilizing t.TempDir() within chtmpdir function. It also replaces os.Exit(1) with t.Fatalf to handle errors more consistently with Go's testing practice. The cleanup process is now managed with t.Cleanup, ensuring that any created temporary directories are removed without the need for a deferred restore function. Updates golang#45182
This PR (HEAD: 25ba510) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/546217. Important tips:
|
Message from qiulaidongfeng: Patch Set 2: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/546217. |
Message from Gopher Robot: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/546217. |
Message from Gopher Robot: Patch Set 2: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/546217. |
This PR is being closed because golang.org/cl/546217 has been abandoned. Obsoleted by CL 529896 |
This change simplifies the test code for changing directories by
utilizing t.TempDir() within chtmpdir function. It also replaces os.Exit(1)
with t.Fatalf to handle errors more consistently with Go's testing
practice.
The cleanup process is now managed with t.Cleanup, ensuring that any
created temporary directories are removed without the need for a
deferred restore function.
Updates #45182