From 65a71573836a2f1677472fca514beeaf76fe7cba Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 21 Jul 2024 15:56:03 +0200 Subject: [PATCH] mount: use os instead of fs package --- cmd/restic/cmd_mount.go | 3 +-- internal/fs/file.go | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index 2f57a6d1f..b8a66dc90 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -15,7 +15,6 @@ import ( "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/restic" - resticfs "github.com/restic/restic/internal/fs" "github.com/restic/restic/internal/fuse" systemFuse "github.com/anacrolix/fuse" @@ -122,7 +121,7 @@ func runMount(ctx context.Context, opts MountOptions, gopts GlobalOptions, args // Check the existence of the mount point at the earliest stage to // prevent unnecessary computations while opening the repository. - if _, err := resticfs.Stat(mountpoint); errors.Is(err, os.ErrNotExist) { + if _, err := os.Stat(mountpoint); errors.Is(err, os.ErrNotExist) { Verbosef("Mountpoint %s doesn't exist\n", mountpoint) return err } diff --git a/internal/fs/file.go b/internal/fs/file.go index b727df79c..c1ebae081 100644 --- a/internal/fs/file.go +++ b/internal/fs/file.go @@ -60,12 +60,6 @@ func Link(oldname, newname string) error { return os.Link(fixpath(oldname), fixpath(newname)) } -// Stat returns a FileInfo structure describing the named file. -// If there is an error, it will be of type *PathError. -func Stat(name string) (os.FileInfo, error) { - return os.Stat(fixpath(name)) -} - // Lstat returns the FileInfo structure describing the named file. // If the file is a symbolic link, the returned FileInfo // describes the symbolic link. Lstat makes no attempt to follow the link.