]> Cypherpunks repositories - gostls13.git/commit
os: improve newFile, rm newDir
authorKir Kolyshkin <kolyshkin@gmail.com>
Wed, 12 Jun 2024 00:25:06 +0000 (17:25 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 21 Jun 2024 18:48:03 +0000 (18:48 +0000)
commit1b4f1dc95d221c1e9d0afb9067fd6a09f12dd061
tree771b6dc49679b19626a11aeede72acaa20a824cc
parent72e2220b50db5179ddca2226a64bf1d3aa94f49a
os: improve newFile, rm newDir

1. Assuming that CI environments do not use NFS (and if they do,
   they have TMPDIR set pointing to a local file system), we can

 - remove localTmp;
 - remove newDir, replacing calls to it with t.TempDir;
 - remove repeated comments about NFS.

2. Use t.Name, t.Cleanup and t.Helper to improve newFile and simplify
   its usage. Ensure the cleanup reports all errors.

Change-Id: I0a79a6a3d52faa323ed2658ef73f8802847f3c09
Reviewed-on: https://go-review.googlesource.com/c/go/+/592096
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/os/os_test.go
src/os/os_unix_test.go