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"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (*BasicFilesystem) SymlinksSupported() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *BasicFilesystem) CreateSymlink(target, name string) error {
|
func (f *BasicFilesystem) CreateSymlink(target, name string) error {
|
||||||
name, err := f.rooted(name)
|
name, err := f.rooted(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -23,10 +23,6 @@ import (
|
|||||||
|
|
||||||
var errNotSupported = errors.New("symlinks not supported")
|
var errNotSupported = errors.New("symlinks not supported")
|
||||||
|
|
||||||
func (BasicFilesystem) SymlinksSupported() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (BasicFilesystem) ReadSymlink(path string) (string, error) {
|
func (BasicFilesystem) ReadSymlink(path string) (string, error) {
|
||||||
return "", errNotSupported
|
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) RemoveAll(_ string) error { return fs.err }
|
||||||
func (fs *errorFilesystem) Rename(_, _ 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 (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) Walk(_ string, _ WalkFunc) error { return fs.err }
|
||||||
func (fs *errorFilesystem) Unhide(_ string) error { return fs.err }
|
func (fs *errorFilesystem) Unhide(_ string) error { return fs.err }
|
||||||
func (fs *errorFilesystem) Hide(_ 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)
|
return fs.Lstat(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*fakeFS) SymlinksSupported() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*fakeFS) Walk(_ string, _ WalkFunc) error {
|
func (*fakeFS) Walk(_ string, _ WalkFunc) error {
|
||||||
return errors.New("not implemented")
|
return errors.New("not implemented")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ type Filesystem interface {
|
|||||||
RemoveAll(name string) error
|
RemoveAll(name string) error
|
||||||
Rename(oldname, newname string) error
|
Rename(oldname, newname string) error
|
||||||
Stat(name string) (FileInfo, error)
|
Stat(name string) (FileInfo, error)
|
||||||
SymlinksSupported() bool
|
|
||||||
Walk(name string, walkFn WalkFunc) error
|
Walk(name string, walkFn WalkFunc) error
|
||||||
// If setup fails, returns non-nil error, and if afterwards a fatal (!)
|
// If setup fails, returns non-nil error, and if afterwards a fatal (!)
|
||||||
// error occurs, sends that error on the channel. Afterwards this watch
|
// 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
|
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 {
|
func (fs *logFilesystem) Walk(root string, walkFn WalkFunc) error {
|
||||||
err := fs.Filesystem.Walk(root, walkFn)
|
err := fs.Filesystem.Walk(root, walkFn)
|
||||||
l.Debugln(fs.getCaller(), fs.Type(), fs.URI(), "Walk", root, walkFn, err)
|
l.Debugln(fs.getCaller(), fs.Type(), fs.URI(), "Walk", root, walkFn, err)
|
||||||
|
|||||||
+30
-36
@@ -38,37 +38,36 @@ var (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// fs operations
|
// fs operations
|
||||||
metricOpChmod = "chmod"
|
metricOpChmod = "chmod"
|
||||||
metricOpLchmod = "lchmod"
|
metricOpLchmod = "lchmod"
|
||||||
metricOpChtimes = "chtimes"
|
metricOpChtimes = "chtimes"
|
||||||
metricOpCreate = "create"
|
metricOpCreate = "create"
|
||||||
metricOpCreateSymlink = "createsymlink"
|
metricOpCreateSymlink = "createsymlink"
|
||||||
metricOpDirNames = "dirnames"
|
metricOpDirNames = "dirnames"
|
||||||
metricOpLstat = "lstat"
|
metricOpLstat = "lstat"
|
||||||
metricOpMkdir = "mdkir"
|
metricOpMkdir = "mdkir"
|
||||||
metricOpMkdirAll = "mkdirall"
|
metricOpMkdirAll = "mkdirall"
|
||||||
metricOpOpen = "open"
|
metricOpOpen = "open"
|
||||||
metricOpOpenFile = "openfile"
|
metricOpOpenFile = "openfile"
|
||||||
metricOpReadSymlink = "readsymlink"
|
metricOpReadSymlink = "readsymlink"
|
||||||
metricOpRemove = "remove"
|
metricOpRemove = "remove"
|
||||||
metricOpRemoveAll = "removeall"
|
metricOpRemoveAll = "removeall"
|
||||||
metricOpRename = "rename"
|
metricOpRename = "rename"
|
||||||
metricOpStat = "stat"
|
metricOpStat = "stat"
|
||||||
metricOpSymlinksSupported = "symlinkssupported"
|
metricOpWalk = "walk"
|
||||||
metricOpWalk = "walk"
|
metricOpWatch = "watch"
|
||||||
metricOpWatch = "watch"
|
metricOpHide = "hide"
|
||||||
metricOpHide = "hide"
|
metricOpUnhide = "unhide"
|
||||||
metricOpUnhide = "unhide"
|
metricOpGlob = "glob"
|
||||||
metricOpGlob = "glob"
|
metricOpRoots = "roots"
|
||||||
metricOpRoots = "roots"
|
metricOpUsage = "usage"
|
||||||
metricOpUsage = "usage"
|
metricOpType = "type"
|
||||||
metricOpType = "type"
|
metricOpURI = "uri"
|
||||||
metricOpURI = "uri"
|
metricOpOptions = "options"
|
||||||
metricOpOptions = "options"
|
metricOpSameFile = "samefile"
|
||||||
metricOpSameFile = "samefile"
|
metricOpPlatformData = "platformdata"
|
||||||
metricOpPlatformData = "platformdata"
|
metricOpGetXattr = "getxattr"
|
||||||
metricOpGetXattr = "getxattr"
|
metricOpSetXattr = "setxattr"
|
||||||
metricOpSetXattr = "setxattr"
|
|
||||||
|
|
||||||
// file operations
|
// file operations
|
||||||
metricOpRead = "read"
|
metricOpRead = "read"
|
||||||
@@ -194,11 +193,6 @@ func (m *metricsFS) Stat(name string) (FileInfo, error) {
|
|||||||
return m.next.Stat(name)
|
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 {
|
func (m *metricsFS) Walk(name string, walkFn WalkFunc) error {
|
||||||
defer m.account(metricOpWalk)(-1)
|
defer m.account(metricOpWalk)(-1)
|
||||||
return m.next.Walk(name, walkFn)
|
return m.next.Walk(name, walkFn)
|
||||||
|
|||||||
Reference in New Issue
Block a user