Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac17078

Browse files
committed
Flip the if
1 parent 3f1f23e commit ac17078

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

testutil/temp.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
func TempDir(t *testing.T) string {
1010
t.Helper()
1111
dir := t.TempDir()
12-
t.Cleanup(func() {
13-
if runtime.GOOS == "windows" {
12+
if runtime.GOOS == "windows" {
13+
t.Cleanup(func() {
1414
tries := 50
1515
var err error
1616
for i := 0; i < tries; i++ {
@@ -22,7 +22,7 @@ func TempDir(t *testing.T) string {
2222
// Note that even though we're giving up here, t.TempDir
2323
// cleanup _could_ still succeed (or fail the test).
2424
t.Logf("TempDir: delete %q: giving up after %d tries: %v", dir, tries, err)
25-
}
26-
})
25+
})
26+
}
2727
return dir
2828
}

0 commit comments

Comments
 (0)