diff options
author | Bryan C. Mills <bcmills@google.com> | 2020-05-19 15:04:48 -0400 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2020-05-19 19:55:14 +0000 |
commit | 13617380cab47a0cfba74650f1539fb2e72bb0fa (patch) | |
tree | 8f8bc9bef335cac6be71bd084e8973aeff426fa6 /src/testing | |
parent | 2dbbc867dbf44f72422d1827d18a2055f9b7b72f (diff) | |
download | go-13617380cab47a0cfba74650f1539fb2e72bb0fa.tar.gz go-13617380cab47a0cfba74650f1539fb2e72bb0fa.zip |
testing: clean up remaining TempDir issues from CL 231958
Updates #38850
Change-Id: I33f48762f5520eb0c0a841d8ca1ccdd65ecc20c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/234583
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go index aa1584f2d9..608bb39671 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -822,11 +822,10 @@ var tempDirReplacer struct { } // TempDir returns a temporary directory for the test to use. -// It is lazily created on first access, and calls t.Fatal if the directory -// creation fails. -// Subsequent calls to t.TempDir return the same directory. // The directory is automatically removed by Cleanup when the test and // all its subtests complete. +// Each subsequent call to t.TempDir returns a unique directory; +// if the directory creation fails, TempDir terminates the test by calling Fatal. func (c *common) TempDir() string { // Use a single parent directory for all the temporary directories // created by a test, each numbered sequentially. |