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

Skip to content

Commit 1f600fc

Browse files
authored
chore: use defer instead of t.Cleanup for chdir (coder#6887)
This _might_ resolve the races in `TestTemplatePush`.
1 parent b26f306 commit 1f600fc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cli/templatepush_test.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ func TestTemplatePush(t *testing.T) {
178178
require.NoError(t, err)
179179

180180
os.Chdir(source)
181-
182-
t.Cleanup(func() {
183-
os.Chdir(oldDir)
184-
})
181+
defer os.Chdir(oldDir)
185182

186183
// Don't pass the name of the template, it should use the
187184
// directory of the source.

0 commit comments

Comments
 (0)