mirror of
https://github.com/syncthing/syncthing.git
synced 2026-05-25 01:15:14 -04:00
chore(fs): remove unused SymlinksSupported() method (#10684)
💀 Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -16,10 +16,6 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (*BasicFilesystem) SymlinksSupported() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) CreateSymlink(target, name string) error {
|
||||
name, err := f.rooted(name)
|
||||
if err != nil {
|
||||
|
||||
@@ -23,10 +23,6 @@ import (
|
||||
|
||||
var errNotSupported = errors.New("symlinks not supported")
|
||||
|
||||
func (BasicFilesystem) SymlinksSupported() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (BasicFilesystem) ReadSymlink(path string) (string, error) {
|
||||
return "", errNotSupported
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ func (fs *errorFilesystem) Remove(_ string) error { retur
|
||||
func (fs *errorFilesystem) RemoveAll(_ string) error { return fs.err }
|
||||
func (fs *errorFilesystem) Rename(_, _ string) error { return fs.err }
|
||||
func (fs *errorFilesystem) Stat(_ string) (FileInfo, error) { return nil, fs.err }
|
||||
func (*errorFilesystem) SymlinksSupported() bool { return false }
|
||||
func (fs *errorFilesystem) Walk(_ string, _ WalkFunc) error { return fs.err }
|
||||
func (fs *errorFilesystem) Unhide(_ string) error { return fs.err }
|
||||
func (fs *errorFilesystem) Hide(_ string) error { return fs.err }
|
||||
|
||||
@@ -629,10 +629,6 @@ func (fs *fakeFS) Stat(name string) (FileInfo, error) {
|
||||
return fs.Lstat(name)
|
||||
}
|
||||
|
||||
func (*fakeFS) SymlinksSupported() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (*fakeFS) Walk(_ string, _ WalkFunc) error {
|
||||
return errors.New("not implemented")
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ type Filesystem interface {
|
||||
RemoveAll(name string) error
|
||||
Rename(oldname, newname string) error
|
||||
Stat(name string) (FileInfo, error)
|
||||
SymlinksSupported() bool
|
||||
Walk(name string, walkFn WalkFunc) error
|
||||
// If setup fails, returns non-nil error, and if afterwards a fatal (!)
|
||||
// error occurs, sends that error on the channel. Afterwards this watch
|
||||
|
||||
@@ -127,12 +127,6 @@ func (fs *logFilesystem) Stat(name string) (FileInfo, error) {
|
||||
return info, err
|
||||
}
|
||||
|
||||
func (fs *logFilesystem) SymlinksSupported() bool {
|
||||
supported := fs.Filesystem.SymlinksSupported()
|
||||
l.Debugln(fs.getCaller(), fs.Type(), fs.URI(), "SymlinksSupported", supported)
|
||||
return supported
|
||||
}
|
||||
|
||||
func (fs *logFilesystem) Walk(root string, walkFn WalkFunc) error {
|
||||
err := fs.Filesystem.Walk(root, walkFn)
|
||||
l.Debugln(fs.getCaller(), fs.Type(), fs.URI(), "Walk", root, walkFn, err)
|
||||
|
||||
@@ -38,37 +38,36 @@ var (
|
||||
|
||||
const (
|
||||
// fs operations
|
||||
metricOpChmod = "chmod"
|
||||
metricOpLchmod = "lchmod"
|
||||
metricOpChtimes = "chtimes"
|
||||
metricOpCreate = "create"
|
||||
metricOpCreateSymlink = "createsymlink"
|
||||
metricOpDirNames = "dirnames"
|
||||
metricOpLstat = "lstat"
|
||||
metricOpMkdir = "mdkir"
|
||||
metricOpMkdirAll = "mkdirall"
|
||||
metricOpOpen = "open"
|
||||
metricOpOpenFile = "openfile"
|
||||
metricOpReadSymlink = "readsymlink"
|
||||
metricOpRemove = "remove"
|
||||
metricOpRemoveAll = "removeall"
|
||||
metricOpRename = "rename"
|
||||
metricOpStat = "stat"
|
||||
metricOpSymlinksSupported = "symlinkssupported"
|
||||
metricOpWalk = "walk"
|
||||
metricOpWatch = "watch"
|
||||
metricOpHide = "hide"
|
||||
metricOpUnhide = "unhide"
|
||||
metricOpGlob = "glob"
|
||||
metricOpRoots = "roots"
|
||||
metricOpUsage = "usage"
|
||||
metricOpType = "type"
|
||||
metricOpURI = "uri"
|
||||
metricOpOptions = "options"
|
||||
metricOpSameFile = "samefile"
|
||||
metricOpPlatformData = "platformdata"
|
||||
metricOpGetXattr = "getxattr"
|
||||
metricOpSetXattr = "setxattr"
|
||||
metricOpChmod = "chmod"
|
||||
metricOpLchmod = "lchmod"
|
||||
metricOpChtimes = "chtimes"
|
||||
metricOpCreate = "create"
|
||||
metricOpCreateSymlink = "createsymlink"
|
||||
metricOpDirNames = "dirnames"
|
||||
metricOpLstat = "lstat"
|
||||
metricOpMkdir = "mdkir"
|
||||
metricOpMkdirAll = "mkdirall"
|
||||
metricOpOpen = "open"
|
||||
metricOpOpenFile = "openfile"
|
||||
metricOpReadSymlink = "readsymlink"
|
||||
metricOpRemove = "remove"
|
||||
metricOpRemoveAll = "removeall"
|
||||
metricOpRename = "rename"
|
||||
metricOpStat = "stat"
|
||||
metricOpWalk = "walk"
|
||||
metricOpWatch = "watch"
|
||||
metricOpHide = "hide"
|
||||
metricOpUnhide = "unhide"
|
||||
metricOpGlob = "glob"
|
||||
metricOpRoots = "roots"
|
||||
metricOpUsage = "usage"
|
||||
metricOpType = "type"
|
||||
metricOpURI = "uri"
|
||||
metricOpOptions = "options"
|
||||
metricOpSameFile = "samefile"
|
||||
metricOpPlatformData = "platformdata"
|
||||
metricOpGetXattr = "getxattr"
|
||||
metricOpSetXattr = "setxattr"
|
||||
|
||||
// file operations
|
||||
metricOpRead = "read"
|
||||
@@ -194,11 +193,6 @@ func (m *metricsFS) Stat(name string) (FileInfo, error) {
|
||||
return m.next.Stat(name)
|
||||
}
|
||||
|
||||
func (m *metricsFS) SymlinksSupported() bool {
|
||||
defer m.account(metricOpSymlinksSupported)(-1)
|
||||
return m.next.SymlinksSupported()
|
||||
}
|
||||
|
||||
func (m *metricsFS) Walk(name string, walkFn WalkFunc) error {
|
||||
defer m.account(metricOpWalk)(-1)
|
||||
return m.next.Walk(name, walkFn)
|
||||
|
||||
Reference in New Issue
Block a user