diff --git a/src/cmds/restic/integration_helpers_unix_test.go b/src/cmds/restic/integration_helpers_unix_test.go index 43234379f..7f7c301f8 100644 --- a/src/cmds/restic/integration_helpers_unix_test.go +++ b/src/cmds/restic/integration_helpers_unix_test.go @@ -47,9 +47,9 @@ func (e *dirEntry) equals(other *dirEntry) bool { } func nlink(info os.FileInfo) (uint64, error) { - stat, err := restic.ToStatT(info.Sys()) + stat, err := info.Sys().(*syscall.Stat_t) if err { return 0, err } - return stat.Nlink(info), err + return stat.nlink, err } diff --git a/src/restic/node.go b/src/restic/node.go index 77895f741..ea8109727 100644 --- a/src/restic/node.go +++ b/src/restic/node.go @@ -409,7 +409,7 @@ func (node *Node) IsNewer(path string, fi os.FileInfo) bool { size := uint64(fi.Size()) - extendedStat, ok := ToStatT(fi.Sys()) + extendedStat, ok := toStatT(fi.Sys()) if !ok { if node.ModTime != fi.ModTime() || node.Size != size { @@ -475,7 +475,7 @@ func lookupUsername(uid string) (string, error) { } func (node *Node) fillExtra(path string, fi os.FileInfo) error { - stat, ok := ToStatT(fi.Sys()) + stat, ok := toStatT(fi.Sys()) if !ok { return nil } diff --git a/src/restic/node_unix.go b/src/restic/node_unix.go index 97a190bb2..eec07fc5a 100644 --- a/src/restic/node_unix.go +++ b/src/restic/node_unix.go @@ -12,8 +12,7 @@ var lchown = os.Lchown type statUnix syscall.Stat_t -//ToStatT call the unix system call stat. -func ToStatT(i interface{}) (statT, bool) { +func toStatT(i interface{}) (statT, bool) { if i == nil { return nil, false } diff --git a/src/restic/node_windows.go b/src/restic/node_windows.go index 0c1513099..43b6d9b62 100644 --- a/src/restic/node_windows.go +++ b/src/restic/node_windows.go @@ -25,7 +25,7 @@ func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespe type statWin syscall.Win32FileAttributeData //ToStatT call the Windows system call Win32FileAttributeData. -func ToStatT(i interface{}) (statT, bool) { +func toStatT(i interface{}) (statT, bool) { if i == nil { return nil, false }