Skip to content

MaricoHan/go-progress-bar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-progress-bar

a progress-bar with golang

install

go get -u github.com/MaricoHan/go-progress-bar

how to use

package main

import (
	"time"

	"MaricoHan/go-progress-bar"
)

func main() {
	opts := []progress.Option{
		progress.WithInterval(time.Second / 5),
		progress.WithETAFormat("2006-01-02 15:04:05"),
		progress.WithFillerLength(25),
	}
	bar := progress.New(100, append(opts, progress.WithFiller("⭐️"))...)
	for i := 0; i < 100; i++ {
		time.Sleep(time.Second / 50)
		bar.Done(1)
	}
	bar.Finish()
}

result display

[⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️]100/100 [eta]2023-03-29 09:34:10 [qps]33 

About

a progress-bar with golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%