refactor: WithSort
Vladimir Bauer
9 years ago
| 13 | 13 |
|
| 14 | 14 |
func main() {
|
| 15 | 15 |
|
| 16 | |
p := mpb.New().RefreshRate(80 * time.Millisecond).Sort(mpb.SortTop).SetWidth(60)
|
|
16 |
p := mpb.New().RefreshRate(80 * time.Millisecond).WithSort(mpb.SortTop).SetWidth(60)
|
| 17 | 17 |
|
| 18 | 18 |
bar1 := p.AddBar(100).AppendETA().PrependFunc(getDecor("Bar#1"))
|
| 19 | 19 |
go func() {
|
| 83 | 83 |
return p
|
| 84 | 84 |
}
|
| 85 | 85 |
|
| 86 | |
func (p *Progress) Sort(sort SortType) *Progress {
|
|
86 |
func (p *Progress) WithSort(sort SortType) *Progress {
|
| 87 | 87 |
p.sort = sort
|
| 88 | 88 |
return p
|
| 89 | 89 |
}
|