func (p *Progress) Fail() {
	switch p.style {
	case spinner:
		p.c <- fail
		close(p.c)
	case bar:
		p.cf <- -2.0
		close(p.cf)
	case loading:
		p.c <- success
		close(p.c)
	}
	p.wg.Wait()
}
Fail should be called on a progress bar or spinner
if a failure occurs
package clt
import (
	"fmt"
	"io"
	"os"
	"strings"
	"sync"
	"time"
)
const (
	success int = iota
	fail
)
const (
	spinner int = iota
	bar
	loading
)
type Spinner []string
var (
	Wheel Spinner = []string{"|", "/", "-", "\\"}
	Bouncing Spinner = []string{"⠁", "⠂", "⠄", "⠂"}
	Clock Spinner = []string{"🕐 ", "🕑 ", "🕒 ", "🕓 ", "🕔 ", "🕕 ", "🕖 ", "🕗 ", "🕘 ", "🕙 ", "🕚 "}
	Dots Spinner = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
)
type Progress struct {
	Prompt string
	DisplayLength int
	style       int
	cf          chan float64
	c           chan int
	steps       int
	currentStep int
	spinsteps   Spinner
	delay       time.Duration
	output      io.Writer
	wg          sync.WaitGroup
	mu          sync.Mutex
}
func NewProgressSpinner(format string, args ...interface{}) *Progress {
	return &Progress{
		style:         spinner,
		Prompt:        fmt.Sprintf(format, args...),
		DisplayLength: 30,
		output:        os.Stdout,
		spinsteps:     Wheel,
	}
}
func NewProgressBar(format string, args ...interface{}) *Progress {
	return &Progress{
		style:         bar,
		Prompt:        fmt.Sprintf(format, args...),
		DisplayLength: 20,
		output:        os.Stdout,
	}
}
func NewIncrementalProgressBar(steps int, format string, args ...interface{}) *Progress {
	return &Progress{
		style:         bar,
		Prompt:        fmt.Sprintf(format, args...),
		DisplayLength: 20,
		output:        os.Stdout,
		steps:         steps,
	}
}
func NewLoadingMessage(message string, spinner Spinner, delay time.Duration) *Progress {
	return &Progress{
		style:         loading,
		Prompt:        message,
		DisplayLength: 0,
		spinsteps:     spinner,
		output:        os.Stdout,
		delay:         delay,
	}
}
func (p *Progress) Start() {
	p.wg.Add(1)
	switch p.style {
	case spinner:
		p.c = make(chan int)
		go renderSpinner(p, p.c)
	case bar:
		p.cf = make(chan float64, 2)
		go renderBar(p, p.cf)
		p.cf <- 0.0
	case loading:
		p.c = make(chan int)
		go renderLoading(p, p.c)
	}
}
func (p *Progress) Success() {
	switch p.style {
	case spinner:
		p.c <- success
		close(p.c)
	case bar:
		p.cf <- -1.0
		close(p.cf)
	case loading:
		p.c <- success
		close(p.c)
	}
	p.wg.Wait()
}