首页 > 其他 > 详细

后端程序员之路 59、go uiprogress

时间:2017-10-30 13:33:46      阅读:276      评论:0      收藏:0      [点我收藏+]

gosuri/uiprogress: A go library to render progress bars in terminal applications
https://github.com/gosuri/uiprogress

 

依赖go-isatty,用于判断程序是在什么终端运行
https://github.com/mattn/go-isatty

依赖uilive,提供一个定时刷新的命令行输出
https://github.com/gosuri/uilive

 

uiprogress.Start()            // start rendering
bar := uiprogress.AddBar(100) // Add a new bar

// optionally, append and prepend completion and elapsed time
bar.AppendCompleted()
bar.PrependElapsed()

for bar.Incr() {
  time.Sleep(time.Millisecond * 20)
}

  

后端程序员之路 59、go uiprogress

原文:http://www.cnblogs.com/zapline/p/7753796.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!