Skip to content

Commit 738bb67

Browse files
committed
Use a close function instead of a close channel
1 parent 17d310f commit 738bb67

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func main() {
5858

5959
// DFUDiscovery is the implementation of the DFU pluggable-discovery
6060
type DFUDiscovery struct {
61-
closeChan chan<- struct{}
61+
close func()
6262
portsCache map[string]*discovery.Port
6363
}
6464

@@ -108,7 +108,9 @@ func (d *DFUDiscovery) StartSync(eventCB discovery.EventCallback, errorCB discov
108108
}
109109
}
110110
}()
111-
d.closeChan = closeChan
111+
d.close = func() {
112+
close(closeChan)
113+
}
112114
return nil
113115
}
114116

0 commit comments

Comments
 (0)