]> Cypherpunks repositories - gostls13.git/commitdiff
os: clean up after TestIssue60181
authorJoel Sing <joel@sing.id.au>
Wed, 10 Jul 2024 13:20:11 +0000 (23:20 +1000)
committerGopher Robot <gobot@golang.org>
Fri, 12 Jul 2024 16:31:06 +0000 (16:31 +0000)
This test currently leaves two temp files lying around - ensure these
are created in the current working directory (a temp dir) so that they
get cleaned up when the test is complete.

Change-Id: I9a29e24a2cd601de3ab39c421830ee2bcda76516
Reviewed-on: https://go-review.googlesource.com/c/go/+/597317
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

src/os/os_unix_test.go

index 6cbeae1b786d4462b5e7f5d66899837897c871f2..fcc75e5ee613605e38ba13c60b8743cd2eba9e06 100644 (file)
@@ -376,14 +376,14 @@ func TestIssue60181(t *testing.T) {
 
        want := "hello gopher"
 
-       a, err := CreateTemp("", "a")
+       a, err := CreateTemp(".", "a")
        if err != nil {
                t.Fatal(err)
        }
        a.WriteString(want[:5])
        a.Close()
 
-       b, err := CreateTemp("", "b")
+       b, err := CreateTemp(".", "b")
        if err != nil {
                t.Fatal(err)
        }