cheggaaa / pb

Console progress bar for Golang
BSD 3-Clause "New" or "Revised" License
3.64k stars 269 forks source link

How to add break line to Prefix #161

Open minhkhiemm opened 4 years ago

minhkhiemm commented 4 years ago

I want to add the break line between prefix and the progress bar [1/3]Prefix [2/3]#####################################################--------------------------------------------------------------------------------------------21/58

to be like this:

[1/3]Prefix 
[2/3]#####################################################--------------------------------------------------------------------------------------------21/58

my code:

bar.Prefix(fmt.Sprintf("[1/3] Prefix)) // add \n after this won't work
bar.Increment()
bar.BarEnd = fmt.Sprintf(
 "%v/%v",
 bar.Get(),
 len(total),
                  )

Many thanks!!