Skip to content

Commit f23c412

Browse files
all: fix unused method receiver (syncthing#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>
1 parent 24e230d commit f23c412

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/connections/tcp_listen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (t *tcpListener) Factory() listenerFactory {
214214
return t.factory
215215
}
216216

217-
func (t *tcpListener) NATType() string {
217+
func (*tcpListener) NATType() string {
218218
return "unknown"
219219
}
220220

lib/discover/global_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ func (s *fakeDiscoveryServer) handler(w http.ResponseWriter, r *http.Request) {
241241

242242
type fakeAddressLister struct{}
243243

244-
func (f *fakeAddressLister) ExternalAddresses() []string {
244+
func (*fakeAddressLister) ExternalAddresses() []string {
245245
return []string{"tcp://0.0.0.0:22000"}
246246
}
247-
func (f *fakeAddressLister) AllAddresses() []string {
247+
func (*fakeAddressLister) AllAddresses() []string {
248248
return []string{"tcp://0.0.0.0:22000", "tcp://192.168.0.1:22000"}
249249
}

lib/discover/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ func (m *manager) Lookup(ctx context.Context, deviceID protocol.DeviceID) (addre
167167
return addresses, nil
168168
}
169169

170-
func (m *manager) String() string {
170+
func (*manager) String() string {
171171
return "discovery cache"
172172
}
173173

174-
func (m *manager) Error() error {
174+
func (*manager) Error() error {
175175
return nil
176176
}
177177

lib/model/testutils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (c *alwaysChanged) Seen(fs fs.Filesystem, name string) bool {
229229
return ok
230230
}
231231

232-
func (c *alwaysChanged) Changed() bool {
232+
func (*alwaysChanged) Changed() bool {
233233
return true
234234
}
235235

0 commit comments

Comments
 (0)