File: bar_filler_nop.go

package info (click to toggle)
golang-github-vbauerster-mpb 8.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,044 kB
  • sloc: sh: 7; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 534 bytes parent folder | download | duplicates (3)
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
		})
	})
}