aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/vbauerster/mpb/v6/internal
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/vbauerster/mpb/v6/internal')
-rw-r--r--vendor/github.com/vbauerster/mpb/v6/internal/percentage.go19
-rw-r--r--vendor/github.com/vbauerster/mpb/v6/internal/predicate.go6
-rw-r--r--vendor/github.com/vbauerster/mpb/v6/internal/width.go10
3 files changed, 0 insertions, 35 deletions
diff --git a/vendor/github.com/vbauerster/mpb/v6/internal/percentage.go b/vendor/github.com/vbauerster/mpb/v6/internal/percentage.go
deleted file mode 100644
index a8ef8be12..000000000
--- a/vendor/github.com/vbauerster/mpb/v6/internal/percentage.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package internal
-
-import "math"
-
-// Percentage is a helper function, to calculate percentage.
-func Percentage(total, current int64, width int) float64 {
- if total <= 0 {
- return 0
- }
- if current >= total {
- return float64(width)
- }
- return float64(int64(width)*current) / float64(total)
-}
-
-// PercentageRound same as Percentage but with math.Round.
-func PercentageRound(total, current int64, width int) float64 {
- return math.Round(Percentage(total, current, width))
-}
diff --git a/vendor/github.com/vbauerster/mpb/v6/internal/predicate.go b/vendor/github.com/vbauerster/mpb/v6/internal/predicate.go
deleted file mode 100644
index 1e4dd24d9..000000000
--- a/vendor/github.com/vbauerster/mpb/v6/internal/predicate.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package internal
-
-// Predicate helper for internal use.
-func Predicate(pick bool) func() bool {
- return func() bool { return pick }
-}
diff --git a/vendor/github.com/vbauerster/mpb/v6/internal/width.go b/vendor/github.com/vbauerster/mpb/v6/internal/width.go
deleted file mode 100644
index 216320f24..000000000
--- a/vendor/github.com/vbauerster/mpb/v6/internal/width.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package internal
-
-// CheckRequestedWidth checks that requested width doesn't overflow
-// available width
-func CheckRequestedWidth(requested, available int) int {
- if requested <= 0 || requested >= available {
- return available
- }
- return requested
-}