Skip to content

Commit

Permalink
use os.MkdirTemp instead of ioutil.TempDir
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Mar 6, 2024
1 parent ab0fd1a commit 36d4c5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func (c *counter) reset() {

// tempMkdir makes a temporary directory
func tempMkdir(t *testing.T) string {
dir, err := ioutil.TempDir("", "fsnotify")
t.Helper()
dir, err := os.MkdirTemp("", "fsnotify")
if err != nil {
t.Fatalf("failed to create test directory: %s", err)
}
Expand All @@ -53,7 +54,8 @@ func tempMkdir(t *testing.T) string {

// tempMkFile makes a temporary file.
func tempMkFile(t *testing.T, dir string) string {
f, err := ioutil.TempFile(dir, "fsnotify")
t.Helper()
f, err := os.CreateTemp(dir, "fsnotify")
if err != nil {
t.Fatalf("failed to create test file: %v", err)
}
Expand Down

0 comments on commit 36d4c5a

Please sign in to comment.