Use "t.Chdir" to directory is restored after test.

This commit is contained in:
Joachim Bauch 2025-12-09 10:44:16 +01:00
commit 6f35e021f9
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02

View file

@ -94,7 +94,7 @@ func TestFileWatcher_CurrentDir(t *testing.T) { // nolint:paralleltest
require := require.New(t)
assert := assert.New(t)
tmpdir := t.TempDir()
require.NoError(os.Chdir(tmpdir))
t.Chdir(tmpdir)
filename := path.Join(tmpdir, "test.txt")
require.NoError(os.WriteFile(filename, []byte("Hello world!"), 0644))