all: Remove unused method receivers (#8462)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
parent
388e4db9cd
commit
755d21953f
+7
-7
@@ -27,7 +27,7 @@ var (
|
||||
|
||||
type OptionJunctionsAsDirs struct{}
|
||||
|
||||
func (o *OptionJunctionsAsDirs) apply(fs Filesystem) Filesystem {
|
||||
func (*OptionJunctionsAsDirs) apply(fs Filesystem) Filesystem {
|
||||
if basic, ok := fs.(*BasicFilesystem); !ok {
|
||||
l.Warnln("WithJunctionsAsDirs must only be used with FilesystemTypeBasic")
|
||||
} else {
|
||||
@@ -36,7 +36,7 @@ func (o *OptionJunctionsAsDirs) apply(fs Filesystem) Filesystem {
|
||||
return fs
|
||||
}
|
||||
|
||||
func (o *OptionJunctionsAsDirs) String() string {
|
||||
func (*OptionJunctionsAsDirs) String() string {
|
||||
return "junctionsAsDirs"
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ func (f *BasicFilesystem) Create(name string) (File, error) {
|
||||
return basicFile{fd, name}, err
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) Walk(_ string, _ WalkFunc) error {
|
||||
func (*BasicFilesystem) Walk(_ string, _ WalkFunc) error {
|
||||
// implemented in WalkFilesystem
|
||||
return errors.New("not implemented")
|
||||
}
|
||||
@@ -298,7 +298,7 @@ func (f *BasicFilesystem) Usage(name string) (Usage, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) Type() FilesystemType {
|
||||
func (*BasicFilesystem) Type() FilesystemType {
|
||||
return FilesystemTypeBasic
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ func (f *BasicFilesystem) Options() []Option {
|
||||
return f.options
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) SameFile(fi1, fi2 FileInfo) bool {
|
||||
func (*BasicFilesystem) SameFile(fi1, fi2 FileInfo) bool {
|
||||
// Like os.SameFile, we always return false unless fi1 and fi2 were created
|
||||
// by this package's Stat/Lstat method.
|
||||
f1, ok1 := fi1.(basicFileInfo)
|
||||
@@ -322,11 +322,11 @@ func (f *BasicFilesystem) SameFile(fi1, fi2 FileInfo) bool {
|
||||
return os.SameFile(f1.osFileInfo(), f2.osFileInfo())
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) underlying() (Filesystem, bool) {
|
||||
func (*BasicFilesystem) underlying() (Filesystem, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) wrapperType() filesystemWrapperType {
|
||||
func (*BasicFilesystem) wrapperType() filesystemWrapperType {
|
||||
return filesystemWrapperTypeNone
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ func (f *BasicFilesystem) ReadSymlink(name string) (string, error) {
|
||||
return os.Readlink(name)
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) mkdirAll(path string, perm os.FileMode) error {
|
||||
func (*BasicFilesystem) mkdirAll(path string, perm os.FileMode) error {
|
||||
return os.MkdirAll(path, perm)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func (f *BasicFilesystem) Hide(name string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) Roots() ([]string, error) {
|
||||
func (*BasicFilesystem) Roots() ([]string, error) {
|
||||
return []string{"/"}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ func (f *BasicFilesystem) watchLoop(ctx context.Context, name string, roots []st
|
||||
}
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) eventType(notifyType notify.Event) EventType {
|
||||
func (*BasicFilesystem) eventType(notifyType notify.Event) EventType {
|
||||
if notifyType&rmEventMask != 0 {
|
||||
return Remove
|
||||
}
|
||||
|
||||
@@ -627,10 +627,10 @@ func (e fakeEventInfo) Path() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
func (e fakeEventInfo) Event() notify.Event {
|
||||
func (fakeEventInfo) Event() notify.Event {
|
||||
return notify.Write
|
||||
}
|
||||
|
||||
func (e fakeEventInfo) Sys() interface{} {
|
||||
func (fakeEventInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
+3
-3
@@ -131,11 +131,11 @@ var globalCaseFilesystemRegistry = caseFilesystemRegistry{fss: make(map[fskey]*c
|
||||
// used if the filesystem is known to already behave case-sensitively.
|
||||
type OptionDetectCaseConflicts struct{}
|
||||
|
||||
func (o *OptionDetectCaseConflicts) apply(fs Filesystem) Filesystem {
|
||||
func (*OptionDetectCaseConflicts) apply(fs Filesystem) Filesystem {
|
||||
return globalCaseFilesystemRegistry.get(fs)
|
||||
}
|
||||
|
||||
func (o *OptionDetectCaseConflicts) String() string {
|
||||
func (*OptionDetectCaseConflicts) String() string {
|
||||
return "detectCaseConflicts"
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ func (f *caseFilesystem) underlying() (Filesystem, bool) {
|
||||
return f.Filesystem, true
|
||||
}
|
||||
|
||||
func (f *caseFilesystem) wrapperType() filesystemWrapperType {
|
||||
func (*caseFilesystem) wrapperType() filesystemWrapperType {
|
||||
return filesystemWrapperTypeCase
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -37,7 +37,7 @@ 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 (fs *errorFilesystem) SymlinksSupported() bool { return false }
|
||||
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 }
|
||||
@@ -47,10 +47,10 @@ func (fs *errorFilesystem) Roots() ([]string, error) { retur
|
||||
func (fs *errorFilesystem) Usage(_ string) (Usage, error) { return Usage{}, fs.err }
|
||||
func (fs *errorFilesystem) Type() FilesystemType { return fs.fsType }
|
||||
func (fs *errorFilesystem) URI() string { return fs.uri }
|
||||
func (fs *errorFilesystem) Options() []Option {
|
||||
func (*errorFilesystem) Options() []Option {
|
||||
return nil
|
||||
}
|
||||
func (fs *errorFilesystem) SameFile(_, _ FileInfo) bool { return false }
|
||||
func (*errorFilesystem) SameFile(_, _ FileInfo) bool { return false }
|
||||
func (fs *errorFilesystem) Watch(_ string, _ Matcher, _ context.Context, _ bool) (<-chan Event, <-chan error, error) {
|
||||
return nil, nil, fs.err
|
||||
}
|
||||
@@ -58,10 +58,10 @@ func (fs *errorFilesystem) PlatformData(_ string) (protocol.PlatformData, error)
|
||||
return protocol.PlatformData{}, fs.err
|
||||
}
|
||||
|
||||
func (fs *errorFilesystem) underlying() (Filesystem, bool) {
|
||||
func (*errorFilesystem) underlying() (Filesystem, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (fs *errorFilesystem) wrapperType() filesystemWrapperType {
|
||||
func (*errorFilesystem) wrapperType() filesystemWrapperType {
|
||||
return filesystemWrapperTypeError
|
||||
}
|
||||
|
||||
+13
-13
@@ -597,23 +597,23 @@ func (fs *fakeFS) Stat(name string) (FileInfo, error) {
|
||||
return fs.Lstat(name)
|
||||
}
|
||||
|
||||
func (fs *fakeFS) SymlinksSupported() bool {
|
||||
func (*fakeFS) SymlinksSupported() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Walk(_ string, _ WalkFunc) error {
|
||||
func (*fakeFS) Walk(_ string, _ WalkFunc) error {
|
||||
return errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Watch(_ string, _ Matcher, _ context.Context, _ bool) (<-chan Event, <-chan error, error) {
|
||||
func (*fakeFS) Watch(_ string, _ Matcher, _ context.Context, _ bool) (<-chan Event, <-chan error, error) {
|
||||
return nil, nil, ErrWatchNotSupported
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Hide(_ string) error {
|
||||
func (*fakeFS) Hide(_ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Unhide(_ string) error {
|
||||
func (*fakeFS) Unhide(_ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -622,15 +622,15 @@ func (fs *fakeFS) Glob(_ string) ([]string, error) {
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Roots() ([]string, error) {
|
||||
func (*fakeFS) Roots() ([]string, error) {
|
||||
return []string{"/"}, nil
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Usage(_ string) (Usage, error) {
|
||||
func (*fakeFS) Usage(_ string) (Usage, error) {
|
||||
return Usage{}, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Type() FilesystemType {
|
||||
func (*fakeFS) Type() FilesystemType {
|
||||
return FilesystemTypeFake
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ func (fs *fakeFS) URI() string {
|
||||
return fs.uri
|
||||
}
|
||||
|
||||
func (fs *fakeFS) Options() []Option {
|
||||
func (*fakeFS) Options() []Option {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -661,11 +661,11 @@ func (fs *fakeFS) PlatformData(name string) (protocol.PlatformData, error) {
|
||||
return unixPlatformData(fs, name)
|
||||
}
|
||||
|
||||
func (fs *fakeFS) underlying() (Filesystem, bool) {
|
||||
func (*fakeFS) underlying() (Filesystem, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (fs *fakeFS) wrapperType() filesystemWrapperType {
|
||||
func (*fakeFS) wrapperType() filesystemWrapperType {
|
||||
return filesystemWrapperTypeNone
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ type fakeFile struct {
|
||||
presentedName string // present (i.e. != "") on insensitive fs only
|
||||
}
|
||||
|
||||
func (f *fakeFile) Close() error {
|
||||
func (*fakeFile) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -912,7 +912,7 @@ func (f *fakeFile) Stat() (FileInfo, error) {
|
||||
return info, nil
|
||||
}
|
||||
|
||||
func (f *fakeFile) Sync() error {
|
||||
func (*fakeFile) Sync() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -168,6 +168,6 @@ func (fs *logFilesystem) underlying() (Filesystem, bool) {
|
||||
return fs.Filesystem, true
|
||||
}
|
||||
|
||||
func (fs *logFilesystem) wrapperType() filesystemWrapperType {
|
||||
func (*logFilesystem) wrapperType() filesystemWrapperType {
|
||||
return filesystemWrapperTypeLog
|
||||
}
|
||||
|
||||
+1
-1
@@ -146,7 +146,7 @@ func (f *mtimeFS) underlying() (Filesystem, bool) {
|
||||
return f.Filesystem, true
|
||||
}
|
||||
|
||||
func (f *mtimeFS) wrapperType() filesystemWrapperType {
|
||||
func (*mtimeFS) wrapperType() filesystemWrapperType {
|
||||
return filesystemWrapperTypeMtime
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -154,6 +154,6 @@ func (f *walkFilesystem) underlying() (Filesystem, bool) {
|
||||
return f.Filesystem, true
|
||||
}
|
||||
|
||||
func (f *walkFilesystem) wrapperType() filesystemWrapperType {
|
||||
func (*walkFilesystem) wrapperType() filesystemWrapperType {
|
||||
return filesystemWrapperTypeWalk
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user