百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

multibar

> 编程语言
开源

在 Go (golang) 中显示多个进度条

372 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在 Go (golang) 中显示多个进度条

MultiBar

Display progress bars in Go

$ go run main.go
here we have a progress bar

some work  30% [====================>-------------------------------------------] 925ms
and here we have another progress bar
here we have a longer prepend string  25% [==========>--------------------------] 911ms
working...  19% [=============>-------------------------------------------------] 911ms

Display Options:

When you call .MakeBar(total int, prepend string), the returned progress bar has options that you can change to fit your needs. Here are the defaults:

- Width:           screen width - len(prepend) - 20
- Total:           total (passed in)
- Prepend:         prepend (passed in)
- LeftEnd:         '['
- RightEnd:        ']'
- Fill:            '='
- Head:            '>'
- Empty:           '-'
- ShowPercent:     true
- ShowTimeElapsed: true

Example usage:

(note, in the example gif, we are manually resetting the terminal mode. We NO LONGER have to, issue fixed)

You can run this with cd demo; go run main.go.

…

Idiosyncrasies

When you run tests, a lot of terminal cursor movement happens. This will cause the output to look all kinds of messed up. In most unix systems, clear or cmd+k should clear out the output.

License

See LICENSE.md

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言