Prechádzať zdrojové kódy

unix: check error return of os.Symlink in tests on Linux

Change-Id: Iddb6fbcb0f0f834fa9fd7ef95d57aa8c7b4007fd
Reviewed-on: https://go-review.googlesource.com/87575
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Tobias Klauser 8 rokov pred
rodič
commit
52ba35ddf9
1 zmenil súbory, kde vykonal 9 pridanie a 3 odobranie
  1. 9 3
      unix/syscall_linux_test.go

+ 9 - 3
unix/syscall_linux_test.go

@@ -20,9 +20,12 @@ func TestFchmodat(t *testing.T) {
 	defer chtmpdir(t)()
 
 	touch(t, "file1")
-	os.Symlink("file1", "symlink1")
+	err := os.Symlink("file1", "symlink1")
+	if err != nil {
+		t.Fatal(err)
+	}
 
-	err := unix.Fchmodat(unix.AT_FDCWD, "symlink1", 0444, 0)
+	err = unix.Fchmodat(unix.AT_FDCWD, "symlink1", 0444, 0)
 	if err != nil {
 		t.Fatalf("Fchmodat: unexpected error: %v", err)
 	}
@@ -239,7 +242,10 @@ func TestFstatat(t *testing.T) {
 		t.Errorf("Fstatat: returned stat does not match Stat")
 	}
 
-	os.Symlink("file1", "symlink1")
+	err = os.Symlink("file1", "symlink1")
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	err = unix.Lstat("symlink1", &st1)
 	if err != nil {