Skip to content

Commit 81facfd

Browse files
committed
Use os.WriteFile instead of deprecated ioutil.WriteFile
1 parent 58030d2 commit 81facfd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

rnotify_test.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package rnotify_test
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"os"
76
"path/filepath"
87
"strings"
@@ -71,12 +70,12 @@ func TestWatchDirRecursive(t *testing.T) {
7170
t.Fatal(err)
7271
}
7372

74-
ioutil.WriteFile(fileA, []byte{'a'}, 0600)
73+
os.WriteFile(fileA, []byte{'a'}, 0600)
7574
os.Mkdir(dirB, 0777)
76-
ioutil.WriteFile(fileC, []byte{'c'}, 0600)
75+
os.WriteFile(fileC, []byte{'c'}, 0600)
7776
os.Mkdir(dirD, 0777)
7877
time.Sleep(100 * time.Millisecond)
79-
ioutil.WriteFile(fileE, []byte{'e'}, 0600)
78+
os.WriteFile(fileE, []byte{'e'}, 0600)
8079
os.RemoveAll(dirB)
8180

8281
<-done
@@ -146,9 +145,9 @@ func TestIgnore(t *testing.T) {
146145
t.Fatal(err)
147146
}
148147

149-
ioutil.WriteFile(fileC, []byte{'c'}, 0600)
150-
ioutil.WriteFile(fileA, []byte{'a'}, 0600)
151-
ioutil.WriteFile(fileB, []byte{'b'}, 0600)
148+
os.WriteFile(fileC, []byte{'c'}, 0600)
149+
os.WriteFile(fileA, []byte{'a'}, 0600)
150+
os.WriteFile(fileB, []byte{'b'}, 0600)
152151
time.Sleep(100 * time.Millisecond)
153152

154153
<-done

0 commit comments

Comments
 (0)