minor: send only chan as param
Vladimir Bauer
3 years ago
| 447 | 447 |
}
|
| 448 | 448 |
}
|
| 449 | 449 |
|
| 450 | |
func (b *Bar) forceRefresh(refreshCh chan interface{}) {
|
|
450 |
func (b *Bar) forceRefresh(refreshCh chan<- interface{}) {
|
| 451 | 451 |
b.container.bwg.Add(1)
|
| 452 | 452 |
go b.forceRefreshImpl(refreshCh)
|
| 453 | 453 |
}
|
| 454 | 454 |
|
| 455 | |
func (b *Bar) forceRefreshImpl(refreshCh chan interface{}) {
|
|
455 |
func (b *Bar) forceRefreshImpl(refreshCh chan<- interface{}) {
|
| 456 | 456 |
defer b.container.bwg.Done()
|
| 457 | 457 |
var anyOtherRunning bool
|
| 458 | 458 |
b.container.traverseBars(func(bar *Bar) bool {
|
| 23 | 23 |
}
|
| 24 | 24 |
|
| 25 | 25 |
type iterData struct {
|
| 26 | |
iter chan *Bar
|
|
26 |
iter chan<- *Bar
|
| 27 | 27 |
drop chan struct{}
|
| 28 | 28 |
}
|
| 29 | 29 |
|
|
| 110 | 110 |
m <- heapRequest{cmd: h_push, data: data}
|
| 111 | 111 |
}
|
| 112 | 112 |
|
| 113 | |
func (m heapManager) iter(iter chan *Bar, drop chan struct{}) {
|
|
113 |
func (m heapManager) iter(iter chan<- *Bar, drop chan struct{}) {
|
| 114 | 114 |
data := iterData{iter, drop}
|
| 115 | 115 |
m <- heapRequest{cmd: h_iter, data: data}
|
| 116 | 116 |
}
|
| 117 | 117 |
|
| 118 | |
func (m heapManager) drain(iter chan *Bar, drop chan struct{}) {
|
|
118 |
func (m heapManager) drain(iter chan<- *Bar, drop chan struct{}) {
|
| 119 | 119 |
data := iterData{iter, drop}
|
| 120 | 120 |
m <- heapRequest{cmd: h_drain, data: data}
|
| 121 | 121 |
}
|