refactoring: WrapFiller interface
Vladimir Bauer
6 years ago
| 80 | 80 |
base mpb.Filler
|
| 81 | 81 |
}
|
| 82 | 82 |
|
| 83 | |
// implementing mpb.BaseFiller, so bar.SetRefill works
|
| 84 | |
func (cf *customFiller) BaseFiller() mpb.Filler {
|
|
83 |
// implementing mpb.WrapFiller, so bar.SetRefill works
|
|
84 |
func (cf *customFiller) Base() mpb.Filler {
|
| 85 | 85 |
return cf.base
|
| 86 | 86 |
}
|
| 87 | 87 |
|
| 28 | 28 |
f(w, width, stat)
|
| 29 | 29 |
}
|
| 30 | 30 |
|
| 31 | |
// Wrapper interface.
|
|
31 |
// WrapFiller interface.
|
| 32 | 32 |
// If you're implementing custom Filler by wrapping a built-in one,
|
| 33 | 33 |
// it is necessary to implement this interface to retain functionality
|
| 34 | 34 |
// of built-in Filler.
|
| 35 | |
type Wrapper interface {
|
|
35 |
type WrapFiller interface {
|
| 36 | 36 |
Base() Filler
|
| 37 | 37 |
}
|
| 38 | 38 |
|