major: BarFiller Fill returns error
Vladimir Bauer
3 years ago
| 8 | 8 | // BarFiller interface. |
| 9 | 9 | // Bar (without decorators) renders itself by calling BarFiller's Fill method. |
| 10 | 10 | type BarFiller interface { |
| 11 | Fill(w io.Writer, stat decor.Statistics) | |
| 11 | Fill(w io.Writer, stat decor.Statistics) error | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // BarFillerBuilder interface. |
| 23 | 23 | |
| 24 | 24 | // BarFillerFunc is function type adapter to convert compatible function |
| 25 | 25 | // into BarFiller interface. |
| 26 | type BarFillerFunc func(w io.Writer, stat decor.Statistics) | |
| 26 | type BarFillerFunc func(w io.Writer, stat decor.Statistics) error | |
| 27 | 27 | |
| 28 | func (f BarFillerFunc) Fill(w io.Writer, stat decor.Statistics) { | |
| 29 | f(w, stat) | |
| 28 | func (f BarFillerFunc) Fill(w io.Writer, stat decor.Statistics) error { | |
| 29 | return f(w, stat) | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // BarFillerBuilderFunc is function type adapter to convert compatible |