Codebase list golang-github-vbauerster-mpb / c154afc
do append '\n' in drawer Vladimir Bauer 9 years ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2828
2929 indexedBarBuffer struct {
3030 index int
31 buff []byte
31 buf []byte
3232 }
3333
3434 indexedBar struct {
242242
243243 m := make(map[int][]byte, len(bars))
244244 for r := range c {
245 m[r.index] = r.buff
245 m[r.index] = r.buf
246246 }
247247 for i := 0; i < len(bars); i++ {
248 m[i] = append(m[i], '\n')
249248 cw.Write(m[i])
250249 }
251250
267266
268267 func drawer(ibars <-chan indexedBar, c chan<- indexedBarBuffer) {
269268 for b := range ibars {
270 c <- indexedBarBuffer{b.index, b.bar.bytes(b.width)}
269 buf := b.bar.bytes(b.width)
270 buf = append(buf, '\n')
271 c <- indexedBarBuffer{b.index, buf}
271272 }
272273 }
273274