diff options
Diffstat (limited to '')
-rw-r--r-- | dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/decor/any.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/decor/any.go b/dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/decor/any.go new file mode 100644 index 0000000..39518f5 --- /dev/null +++ b/dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/decor/any.go @@ -0,0 +1,21 @@ +package decor + +// Any decorator displays text, that can be changed during decorator's +// lifetime via provided DecorFunc. +// +// `fn` DecorFunc callback +// +// `wcc` optional WC config +// +func Any(fn DecorFunc, wcc ...WC) Decorator { + return &any{initWC(wcc...), fn} +} + +type any struct { + WC + fn DecorFunc +} + +func (d *any) Decor(s Statistics) string { + return d.FormatMsg(d.fn(s)) +} |