Codebase list golang-github-vbauerster-mpb / 5121310
refactoring receive only chan type Vladimir Bauer 3 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
2424
2525 type iterData struct {
2626 iter chan<- *Bar
27 drop chan struct{}
27 drop <-chan struct{}
2828 }
2929
3030 type pushData struct {
112112 m <- heapRequest{cmd: h_push, data: data}
113113 }
114114
115 func (m heapManager) iter(iter chan<- *Bar, drop chan struct{}) {
115 func (m heapManager) iter(iter chan<- *Bar, drop <-chan struct{}) {
116116 data := iterData{iter, drop}
117117 m <- heapRequest{cmd: h_iter, data: data}
118118 }
119119
120 func (m heapManager) drain(iter chan<- *Bar, drop chan struct{}) {
120 func (m heapManager) drain(iter chan<- *Bar, drop <-chan struct{}) {
121121 data := iterData{iter, drop}
122122 m <- heapRequest{cmd: h_drain, data: data}
123123 }