Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use T.TempDir to create temporary test directory #1308

Merged
merged 2 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: remove redundant Close()
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
  • Loading branch information
Juneezee committed Mar 1, 2022
commit 335403ffcb6871ccaabcc4b51a947678f5a01d4b
2 changes: 0 additions & 2 deletions internal/safefile/safeopen_admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ func TestOpenRelative(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer badroot.Close()

root, err := tempRoot(t)
if err != nil {
t.Fatal(err)
}
defer root.Close()

// Create a file
f, err := OpenRelative("foo", root, 0, syscall.FILE_SHARE_READ, winapi.FILE_CREATE, 0)
Expand Down
1 change: 0 additions & 1 deletion internal/safefile/safeopen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func TestRemoveRelativeReadOnly(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer root.Close()

p := filepath.Join(root.Name(), "foo")
f, err := os.Create(p)
Expand Down