it's ok to setBarPriority even after b.done is closed
Vladimir Bauer
4 years ago
| 259 | 259 | // priority, i.e. bar will be on top. If you don't need to set priority |
| 260 | 260 | // dynamically, better use BarPriority option. |
| 261 | 261 | func (b *Bar) SetPriority(priority int) { |
| 262 | select { | |
| 263 | case <-b.done: | |
| 264 | default: | |
| 265 | b.container.setBarPriority(b, priority) | |
| 266 | } | |
| 262 | b.container.setBarPriority(b, priority) | |
| 267 | 263 | } |
| 268 | 264 | |
| 269 | 265 | // Abort interrupts bar's running goroutine. Call this, if you'd like |