1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
package mpb
import (
"io"
"github.com/vbauerster/mpb/v8/decor"
)
// barFillerBuilderFunc is function type adapter to convert compatible
// function into BarFillerBuilder interface.
type barFillerBuilderFunc func() BarFiller
func (f barFillerBuilderFunc) Build() BarFiller {
return f()
}
// NopStyle provides BarFillerBuilder which builds NOP BarFiller.
func NopStyle() BarFillerBuilder {
return barFillerBuilderFunc(func() BarFiller {
return BarFillerFunc(func(io.Writer, decor.Statistics) error {
return nil
})
})
}
|