From c5d05c672e3dc3afd56cd460f938eaa33315fc87 Mon Sep 17 00:00:00 2001 From: jgfrm Date: Mon, 6 Feb 2017 23:29:57 +0100 Subject: [PATCH] changed nlink to single return type --- src/cmds/restic/integration_helpers_test.go | 8 +------- src/cmds/restic/integration_helpers_unix_test.go | 10 +++------- src/cmds/restic/integration_helpers_windows_test.go | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/cmds/restic/integration_helpers_test.go b/src/cmds/restic/integration_helpers_test.go index c37b1fca3..5bc66c0fa 100644 --- a/src/cmds/restic/integration_helpers_test.go +++ b/src/cmds/restic/integration_helpers_test.go @@ -34,16 +34,10 @@ func walkDir(dir string) <-chan *dirEntry { return nil } - link, err := nlink(info) - if err != nil { - fmt.Fprintf(os.Stderr, "error: %v\n", err) - return nil - } - ch <- &dirEntry{ path: name, fi: info, - link: link, + link: nlink(info), } return nil diff --git a/src/cmds/restic/integration_helpers_unix_test.go b/src/cmds/restic/integration_helpers_unix_test.go index 7f7c301f8..6b2757106 100644 --- a/src/cmds/restic/integration_helpers_unix_test.go +++ b/src/cmds/restic/integration_helpers_unix_test.go @@ -6,7 +6,6 @@ import ( "fmt" "os" "syscall" - "restic" ) func (e *dirEntry) equals(other *dirEntry) bool { @@ -46,10 +45,7 @@ func (e *dirEntry) equals(other *dirEntry) bool { return true } -func nlink(info os.FileInfo) (uint64, error) { - stat, err := info.Sys().(*syscall.Stat_t) - if err { - return 0, err - } - return stat.nlink, err +func nlink(info os.FileInfo) (uint64) { + stat, _ := info.Sys().(*syscall.Stat_t) + return stat.nlink } diff --git a/src/cmds/restic/integration_helpers_windows_test.go b/src/cmds/restic/integration_helpers_windows_test.go index 45743b643..483a0ddcd 100644 --- a/src/cmds/restic/integration_helpers_windows_test.go +++ b/src/cmds/restic/integration_helpers_windows_test.go @@ -26,6 +26,6 @@ func (e *dirEntry) equals(other *dirEntry) bool { return true } -func nlink(info os.FileInfo) (uint64, error) { - return 1, nil +func nlink(info os.FileInfo) (uint64) { + return 1 } \ No newline at end of file