func (pbp *ProgressBarPrinter) AddProgressBar() *ProgressBar {
	pb := &ProgressBar{}
	pbp.lock.Lock()
	pbp.progressBars = append(pbp.progressBars, pb)
	pbp.lock.Unlock()
	return pb
}
AddProgressBar will create a new ProgressBar, register it with this
ProgressBarPrinter, and return it. This must be called at least once before
PrintAndWait is called.
package progressutil
import (
	"fmt"
	"io"
	"os"
	"strings"
	"sync"
	"golang.org/x/crypto/ssh/terminal"
)
var (
	ErrorProgressOutOfBounds = fmt.Errorf("progress is out of bounds (0 to 1)")
	ErrorNoBarsAdded = fmt.Errorf("AddProgressBar hasn't been called yet")
)
type ProgressBar struct {
	lock sync.Mutex
	currentProgress float64
	printBefore     string
	printAfter      string
	done            bool
}
func (pb *ProgressBar) clone() *ProgressBar {
	pb.lock.Lock()
	pbClone := &ProgressBar{
		currentProgress: pb.currentProgress,
		printBefore:     pb.printBefore,
		printAfter:      pb.printAfter,
		done:            pb.done,
	}
	pb.lock.Unlock()
	return pbClone
}
func (pb *ProgressBar) GetCurrentProgress() float64 {
	pb.lock.Lock()
	val := pb.currentProgress
	pb.lock.Unlock()
	return val
}
func (pb *ProgressBar) SetCurrentProgress(progress float64) error {
	if progress < 0 || progress > 1 {
		return ErrorProgressOutOfBounds
	}
	pb.lock.Lock()
	pb.currentProgress = progress
	pb.lock.Unlock()
	return nil
}
func (pb *ProgressBar) GetDone() bool {
	pb.lock.Lock()
	val := pb.done
	pb.lock.Unlock()
	return val
}
func (pb *ProgressBar) SetDone(val bool) {
	pb.lock.Lock()
	pb.done = val
	pb.lock.Unlock()
}
func (pb *ProgressBar) GetPrintBefore() string {
	pb.lock.Lock()
	val := pb.printBefore
	pb.lock.Unlock()
	return val
}
func (pb *ProgressBar) SetPrintBefore(before string) {
	pb.lock.Lock()
	pb.printBefore = before
	pb.lock.Unlock()
}
func (pb *ProgressBar) GetPrintAfter() string {
	pb.lock.Lock()
	val := pb.printAfter
	pb.lock.Unlock()
	return val
}
func (pb *ProgressBar) SetPrintAfter(after string) {
	pb.lock.Lock()
	pb.printAfter = after
	pb.lock.Unlock()
}
type ProgressBarPrinter struct {
	lock sync.Mutex
	DisplayWidth int
	PadToBeEven         bool
	numLinesInLastPrint int
	progressBars        []*ProgressBar
	maxBefore           int
	maxAfter            int
	printToTTYAlways bool
}