From e79dca644e03b0be946a0b2e2b78b64a303ef22e Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Tue, 27 Aug 2024 14:35:10 +0200 Subject: [PATCH] fs: unexport DeviceID --- internal/fs/deviceid_unix.go | 4 ++-- internal/fs/deviceid_windows.go | 4 ++-- internal/fs/fs_local.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/fs/deviceid_unix.go b/internal/fs/deviceid_unix.go index c366221ab..4d5593335 100644 --- a/internal/fs/deviceid_unix.go +++ b/internal/fs/deviceid_unix.go @@ -10,9 +10,9 @@ import ( "github.com/restic/restic/internal/errors" ) -// DeviceID extracts the device ID from an os.FileInfo object by casting it +// deviceID extracts the device ID from an os.FileInfo object by casting it // to syscall.Stat_t -func DeviceID(fi os.FileInfo) (deviceID uint64, err error) { +func deviceID(fi os.FileInfo) (deviceID uint64, err error) { if fi == nil { return 0, errors.New("unable to determine device: fi is nil") } diff --git a/internal/fs/deviceid_windows.go b/internal/fs/deviceid_windows.go index 42355817d..bfb22dc9a 100644 --- a/internal/fs/deviceid_windows.go +++ b/internal/fs/deviceid_windows.go @@ -9,8 +9,8 @@ import ( "github.com/restic/restic/internal/errors" ) -// DeviceID extracts the device ID from an os.FileInfo object by casting it +// deviceID extracts the device ID from an os.FileInfo object by casting it // to syscall.Stat_t -func DeviceID(fi os.FileInfo) (deviceID uint64, err error) { +func deviceID(_ os.FileInfo) (deviceID uint64, err error) { return 0, errors.New("Device IDs are not supported on Windows") } diff --git a/internal/fs/fs_local.go b/internal/fs/fs_local.go index 33d83bf63..019069a55 100644 --- a/internal/fs/fs_local.go +++ b/internal/fs/fs_local.go @@ -48,8 +48,8 @@ func (fs Local) Lstat(name string) (os.FileInfo, error) { // DeviceID extracts the DeviceID from the given FileInfo. If the fs does // not support a DeviceID, it returns an error instead -func (fs Local) DeviceID(fi os.FileInfo) (deviceID uint64, err error) { - return DeviceID(fi) +func (fs Local) DeviceID(fi os.FileInfo) (id uint64, err error) { + return deviceID(fi) } // Join joins any number of path elements into a single path, adding a