decor doc upd
Vladimir Bauer
8 years ago
| 2 | 2 | // license that can be found in the LICENSE file. |
| 3 | 3 | |
| 4 | 4 | /* |
| 5 | Package decor contains common decorators for "github.com/vbauerster/mpb" package. | |
| 5 | Package decor contains common decorators for "github.com/vbauerster/mpb" package. | |
| 6 | 6 | |
| 7 | All decorators returned by this package have some closure state. It is ok to use decorators concurrently, | |
| 8 | unless you share the same decorator among multiple *mpb.Bar instances. To avoid data races, create new | |
| 9 | decorator per *mpb.Bar instance. | |
| 7 | All decorators returned by this package have some closure state. It is ok to use | |
| 8 | decorators concurrently, unless you share the same decorator among multiple | |
| 9 | *mpb.Bar instances. To avoid data races, create new decorator per *mpb.Bar | |
| 10 | instance. | |
| 10 | 11 | |
| 11 | Don't: | |
| 12 | Don't: | |
| 12 | 13 | |
| 13 | p := mpb.New() | |
| 14 | eta := decor.ETA(0, 0) | |
| 15 | p.AddBar(100, mpb.AppendDecorators(eta)) | |
| 16 | p.AddBar(100, mpb.AppendDecorators(eta)) | |
| 14 | p := mpb.New() | |
| 15 | eta := decor.ETA(0, 0) | |
| 16 | p.AddBar(100, mpb.AppendDecorators(eta)) | |
| 17 | p.AddBar(100, mpb.AppendDecorators(eta)) | |
| 17 | 18 | |
| 18 | Do: | |
| 19 | Do: | |
| 19 | 20 | |
| 20 | p := mpb.New() | |
| 21 | p.AddBar(100, mpb.AppendDecorators(decor.ETA(0, 0))) | |
| 22 | p.AddBar(100, mpb.AppendDecorators(decor.ETA(0, 0))) | |
| 21 | p := mpb.New() | |
| 22 | p.AddBar(100, mpb.AppendDecorators(decor.ETA(0, 0))) | |
| 23 | p.AddBar(100, mpb.AppendDecorators(decor.ETA(0, 0))) | |
| 23 | 24 | */ |
| 24 | 25 | package decor |