minor: p.Write chan result
Vladimir Bauer
3 years ago
1 changed file(s) with
2 addition(s)
and
2 deletion(s)
.
Raw diff
Collapse all
Expand all
+2
-2
progress.go
less
more
180
180
n int
181
181
err error
182
182
}
183
ch := make(chan *result)
183
ch := make(chan result)
184
184
select {
185
185
case p.interceptIO <- func(w io.Writer) {
186
186
n, err := w.Write(b)
187
ch <- &result{n, err}
187
ch <- result{n, err}
188
188
}:
189
189
res := <-ch
190
190
return res.n, res.err