4
4
"bytes"
5
5
"context"
6
6
"fmt"
7
- "io/ioutil"
8
7
"os"
9
8
"path/filepath"
10
9
"runtime"
@@ -72,7 +71,7 @@ func TestEventOrdering(t *testing.T) {
72
71
for i , dir := range dirs {
73
72
base := fmt .Sprintf ("%d.txt" , i )
74
73
p := filepath .Join (dir , base )
75
- err := ioutil .WriteFile (p , []byte (base ), os .FileMode (0777 ))
74
+ err := os .WriteFile (p , []byte (base ), os .FileMode (0777 ))
76
75
if err != nil {
77
76
t .Fatal (err )
78
77
}
@@ -237,7 +236,7 @@ func TestRemoveAndAddBack(t *testing.T) {
237
236
path := filepath .Join (f .paths [0 ], "change" )
238
237
239
238
d1 := []byte ("hello\n go\n " )
240
- err := ioutil .WriteFile (path , d1 , 0644 )
239
+ err := os .WriteFile (path , d1 , 0644 )
241
240
if err != nil {
242
241
t .Fatal (err )
243
242
}
@@ -252,7 +251,7 @@ func TestRemoveAndAddBack(t *testing.T) {
252
251
f .assertEvents (path )
253
252
f .events = nil
254
253
255
- err = ioutil .WriteFile (path , d1 , 0644 )
254
+ err = os .WriteFile (path , d1 , 0644 )
256
255
if err != nil {
257
256
t .Fatal (err )
258
257
}
@@ -273,7 +272,7 @@ func TestSingleFile(t *testing.T) {
273
272
f .fsync ()
274
273
275
274
d2 := []byte ("hello\n world\n " )
276
- err := ioutil .WriteFile (path , d2 , 0644 )
275
+ err := os .WriteFile (path , d2 , 0644 )
277
276
if err != nil {
278
277
t .Fatal (err )
279
278
}
@@ -303,7 +302,7 @@ func TestWriteGoodLink(t *testing.T) {
303
302
f := newNotifyFixture (t )
304
303
305
304
goodFile := filepath .Join (f .paths [0 ], "goodFile" )
306
- err := ioutil .WriteFile (goodFile , []byte ("hello" ), 0644 )
305
+ err := os .WriteFile (goodFile , []byte ("hello" ), 0644 )
307
306
if err != nil {
308
307
t .Fatal (err )
309
308
}
0 commit comments