From 81d8fa1cb595f15bc91eee0cc3125dab208685e2 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 28 Jul 2022 17:55:29 +0200 Subject: [PATCH] all: Fix unused method receiver (further) (#8466) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- lib/connections/quic_listen.go | 2 +- lib/connections/relay_listen.go | 2 +- lib/discover/cache_test.go | 12 ++++++------ lib/fs/fakefs.go | 2 +- lib/protocol/benchmark_test.go | 2 +- lib/versioner/external.go | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/connections/quic_listen.go b/lib/connections/quic_listen.go index a2a324d4e..7b8fb6dce 100644 --- a/lib/connections/quic_listen.go +++ b/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 } diff --git a/lib/connections/relay_listen.go b/lib/connections/relay_listen.go index 4de6bc8ea..570d49668 100644 --- a/lib/connections/relay_listen.go +++ b/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" } diff --git a/lib/discover/cache_test.go b/lib/discover/cache_test.go index f23a9b72e..86a11f680 100644 --- a/lib/discover/cache_test.go +++ b/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 } diff --git a/lib/fs/fakefs.go b/lib/fs/fakefs.go index c6c285bf6..70919d0d9 100644 --- a/lib/fs/fakefs.go +++ b/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") } diff --git a/lib/protocol/benchmark_test.go b/lib/protocol/benchmark_test.go index 31b8f6f4c..251540450 100644 --- a/lib/protocol/benchmark_test.go +++ b/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. diff --git a/lib/versioner/external.go b/lib/versioner/external.go index 2365af99b..f47dfa34e 100644 --- a/lib/versioner/external.go +++ b/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 }