sort back
Vladimir Bauer
9 years ago
| 4 | 4 | "errors" |
| 5 | 5 | "io" |
| 6 | 6 | "os" |
| 7 | "sort" | |
| 7 | 8 | "sync" |
| 8 | 9 | "time" |
| 9 | 10 | |
| 205 | 206 | case respCh := <-p.barCountReqCh: |
| 206 | 207 | respCh <- len(bars) |
| 207 | 208 | case <-t.C: |
| 209 | switch p.sort { | |
| 210 | case SortTop: | |
| 211 | sort.Sort(sort.Reverse(SortableBarSlice(bars))) | |
| 212 | case SortBottom: | |
| 213 | sort.Sort(SortableBarSlice(bars)) | |
| 214 | } | |
| 215 | ||
| 208 | 216 | width, _ := cwriter.TerminalWidth() |
| 209 | 217 | ibars := iBarsGen(p.ctx.Done(), bars, width) |
| 210 | 218 | c := make(chan *indexedBarBuffer) |