ソースを参照

add errcheck (#93)

Dan Miller 7 年 前
コミット
a3b012d89f
1 ファイル変更8 行追加2 行削除
  1. 8 2
      pkg/watch/notify_test.go

+ 8 - 2
pkg/watch/notify_test.go

@@ -92,7 +92,10 @@ func TestWatchesAreRecursive(t *testing.T) {
 
 	// add a sub directory
 	subPath := filepath.Join(root.Path(), "sub")
-	os.MkdirAll(subPath, os.ModePerm)
+	err = os.MkdirAll(subPath, os.ModePerm)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	// watch parent
 	err = f.notify.Add(root.Path())
@@ -133,7 +136,10 @@ func TestNewDirectoriesAreRecursivelyWatched(t *testing.T) {
 	f.events = nil
 	// add a sub directory
 	subPath := filepath.Join(root.Path(), "sub")
-	os.MkdirAll(subPath, os.ModePerm)
+	err = os.MkdirAll(subPath, os.ModePerm)
+	if err != nil {
+		f.t.Fatal(err)
+	}
 	// change something inside sub directory
 	changeFilePath := filepath.Join(subPath, "change")
 	_, err = os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0666)