Skip to content

MothScientist/goProgressBar

Repository files navigation

gopher

goProgressBar

  • Easy to use
  • Large selection of built-in options
  • Optimized
  • No external dependencies

Installation

go get github.com/MothScientist/goProgressBar@latest

Launch

package main

import (
	"fmt"
	"time"

	progressbar "github.com/MothScientist/goProgressBar"
)

func main() {
	bar := progressbar.GetNewProgressBar()

	bar.SetSpinner(progressbar.Spinners[1])
	// There is no point in setting the color white in the console,
	// you can save bytes by setting an empty string instead
	bar.SetColors([2]string{"", progressbar.ColorMagenta})
	bar.SetBarLen(100)

	for i := 30; i <= 100; i++ {
		pg, _ := bar.Update(i)
		fmt.Println(pg)
		time.Sleep(300 * time.Millisecond)
	}
}

Examples

example4.png example1.png example3.png example2.png

About

Simple and easy to use progress bar for console

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages