diff options
author | deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> | 2023-07-18 14:34:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 14:34:50 +0000 |
commit | f23c41221b275ce9f41d1d20d1279249f7d09630 (patch) | |
tree | f49079a04608e3815443d98849e47184eede78ad | |
parent | 24e230d455000122fa0e0c8d766a2046cb034863 (diff) | |
download | syncthing-f23c41221b275ce9f41d1d20d1279249f7d09630.tar.gz syncthing-f23c41221b275ce9f41d1d20d1279249f7d09630.zip |
all: fix unused method receiver (#8988)
refactor: fix unused method receiver
Methods with unused receivers can be a symptom of unfinished refactoring or a bug. To keep
the same method signature, omit the receiver name or '_' as it is unused.
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
-rw-r--r-- | lib/connections/tcp_listen.go | 2 | ||||
-rw-r--r-- | lib/discover/global_test.go | 4 | ||||
-rw-r--r-- | lib/discover/manager.go | 4 | ||||
-rw-r--r-- | lib/model/testutils_test.go | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/connections/tcp_listen.go b/lib/connections/tcp_listen.go index c932fc13b..da0830d0f 100644 --- a/lib/connections/tcp_listen.go +++ b/lib/connections/tcp_listen.go @@ -214,7 +214,7 @@ func (t *tcpListener) Factory() listenerFactory { return t.factory } -func (t *tcpListener) NATType() string { +func (*tcpListener) NATType() string { return "unknown" } diff --git a/lib/discover/global_test.go b/lib/discover/global_test.go index 174156b44..3090edcbf 100644 --- a/lib/discover/global_test.go +++ b/lib/discover/global_test.go @@ -241,9 +241,9 @@ func (s *fakeDiscoveryServer) handler(w http.ResponseWriter, r *http.Request) { type fakeAddressLister struct{} -func (f *fakeAddressLister) ExternalAddresses() []string { +func (*fakeAddressLister) ExternalAddresses() []string { return []string{"tcp://0.0.0.0:22000"} } -func (f *fakeAddressLister) AllAddresses() []string { +func (*fakeAddressLister) AllAddresses() []string { return []string{"tcp://0.0.0.0:22000", "tcp://192.168.0.1:22000"} } diff --git a/lib/discover/manager.go b/lib/discover/manager.go index 9f3caf135..efbdc05d2 100644 --- a/lib/discover/manager.go +++ b/lib/discover/manager.go @@ -167,11 +167,11 @@ func (m *manager) Lookup(ctx context.Context, deviceID protocol.DeviceID) (addre return addresses, nil } -func (m *manager) String() string { +func (*manager) String() string { return "discovery cache" } -func (m *manager) Error() error { +func (*manager) Error() error { return nil } diff --git a/lib/model/testutils_test.go b/lib/model/testutils_test.go index 58bc06233..0ec044eca 100644 --- a/lib/model/testutils_test.go +++ b/lib/model/testutils_test.go @@ -229,7 +229,7 @@ func (c *alwaysChanged) Seen(fs fs.Filesystem, name string) bool { return ok } -func (c *alwaysChanged) Changed() bool { +func (*alwaysChanged) Changed() bool { return true } |