Browse Source

all: Fix unused method receiver (further) (#8466)

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
deepsource-autofix[bot] 3 years ago
parent
commit
81d8fa1cb5

+ 1 - 1
lib/connections/quic_listen.go

@@ -214,7 +214,7 @@ func (t *quicListener) NATType() string {
 
 type quicListenerFactory struct{}
 
-func (f *quicListenerFactory) Valid(config.Configuration) error {
+func (*quicListenerFactory) Valid(config.Configuration) error {
 	return nil
 }
 

+ 1 - 1
lib/connections/relay_listen.go

@@ -172,7 +172,7 @@ func (t *relayListener) String() string {
 	return t.uri.String()
 }
 
-func (t *relayListener) NATType() string {
+func (*relayListener) NATType() string {
 	return "unknown"
 }
 

+ 6 - 6
lib/discover/cache_test.go

@@ -83,15 +83,15 @@ func (f *fakeDiscovery) Lookup(_ context.Context, _ protocol.DeviceID) (addresse
 	return f.addresses, nil
 }
 
-func (f *fakeDiscovery) Error() error {
+func (*fakeDiscovery) Error() error {
 	return nil
 }
 
-func (f *fakeDiscovery) String() string {
+func (*fakeDiscovery) String() string {
 	return "fake"
 }
 
-func (f *fakeDiscovery) Cache() map[protocol.DeviceID]CacheEntry {
+func (*fakeDiscovery) Cache() map[protocol.DeviceID]CacheEntry {
 	return nil
 }
 
@@ -133,14 +133,14 @@ func (f *slowDiscovery) Lookup(_ context.Context, _ protocol.DeviceID) (addresse
 	return nil, nil
 }
 
-func (f *slowDiscovery) Error() error {
+func (*slowDiscovery) Error() error {
 	return nil
 }
 
-func (f *slowDiscovery) String() string {
+func (*slowDiscovery) String() string {
 	return "fake"
 }
 
-func (f *slowDiscovery) Cache() map[protocol.DeviceID]CacheEntry {
+func (*slowDiscovery) Cache() map[protocol.DeviceID]CacheEntry {
 	return nil
 }

+ 1 - 1
lib/fs/fakefs.go

@@ -617,7 +617,7 @@ func (*fakeFS) Unhide(_ string) error {
 	return nil
 }
 
-func (fs *fakeFS) Glob(_ string) ([]string, error) {
+func (*fakeFS) Glob(_ string) ([]string, error) {
 	// gnnh we don't seem to actually require this in practice
 	return nil, errors.New("not implemented")
 }

+ 1 - 1
lib/protocol/benchmark_test.go

@@ -175,7 +175,7 @@ func (*fakeModel) IndexUpdate(_ DeviceID, _ string, _ []FileInfo) error {
 	return nil
 }
 
-func (m *fakeModel) Request(_ DeviceID, _, _ string, _, size int32, offset int64, _ []byte, _ uint32, _ bool) (RequestResponse, error) {
+func (*fakeModel) Request(_ DeviceID, _, _ string, _, size int32, offset int64, _ []byte, _ uint32, _ bool) (RequestResponse, error) {
 	// We write the offset to the end of the buffer, so the receiver
 	// can verify that it did in fact get some data back over the
 	// connection.

+ 3 - 3
lib/versioner/external.go

@@ -113,14 +113,14 @@ func (v external) Archive(filePath string) error {
 	return errors.New("file was not removed by external script")
 }
 
-func (v external) GetVersions() (map[string][]FileVersion, error) {
+func (external) GetVersions() (map[string][]FileVersion, error) {
 	return nil, ErrRestorationNotSupported
 }
 
-func (v external) Restore(_ string, _ time.Time) error {
+func (external) Restore(_ string, _ time.Time) error {
 	return ErrRestorationNotSupported
 }
 
-func (v external) Clean(_ context.Context) error {
+func (external) Clean(_ context.Context) error {
 	return nil
 }