Skip to content

Commit f7dedb2

Browse files
committed
Renamed ListSync methods to ListCachedPorts
1 parent 111c1a8 commit f7dedb2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arduino/discovery/discovery.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ func (disc *PluggableDiscovery) StartSync(size int) (<-chan *Event, error) {
424424
return c, nil
425425
}
426426

427-
// ListSync returns a list of the available ports. The list is a cache of all the
427+
// ListCachedPorts returns a list of the available ports. The list is a cache of all the
428428
// add/remove events happened from the StartSync call and it will not consume any
429429
// resource from the underliying discovery.
430-
func (disc *PluggableDiscovery) ListSync() []*Port {
430+
func (disc *PluggableDiscovery) ListCachedPorts() []*Port {
431431
disc.statusMutex.Lock()
432432
defer disc.statusMutex.Unlock()
433433
res := []*Port{}

arduino/discovery/discoverymanager/discoverymanager.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,15 @@ func (dm *DiscoveryManager) List() ([]*discovery.Port, []error) {
242242
return ports, errs
243243
}
244244

245-
// ListSync return the current list of ports detected from all discoveries
246-
func (dm *DiscoveryManager) ListSync() []*discovery.Port {
245+
// ListCachedPorts return the current list of ports detected from all discoveries
246+
func (dm *DiscoveryManager) ListCachedPorts() []*discovery.Port {
247247
res := []*discovery.Port{}
248248
for _, d := range dm.discoveries {
249249
if d.State() != discovery.Syncing {
250250
// Discovery is not syncing
251251
continue
252252
}
253-
res = append(res, d.ListSync()...)
253+
res = append(res, d.ListCachedPorts()...)
254254
}
255255
return res
256256
}

0 commit comments

Comments
 (0)