You can use the ansi escape code if the target terminal supports it. 
Alternatively, you can use the carriage return '\r' and reprint the line. 
Note you may need to overwrite with empty space to delete the line before 
rewriting it.

On Friday, April 1, 2022 at 12:38:37 PM UTC+7 yan.z...@gmail.com wrote:

> I just noticed how python pip upgraded from printing numerous process bars 
> like this:
> ■■■                   30% completed
> ■■■■                 40% completed
> ■■■■■■            60% completed
> ■■■■■■■■       80% completed
> ■■■■■■■■■■  100% completed
>
> to a single line of a growing bar and changing declaration.
>
> It is definitely a functionality that  prompts of both Linux and Windows 
> allows -
> To change the previous print line.
> Is it possible to realize this in golang?
>
>   Zhaoxun
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/80dd0cbc-7bbb-4453-8e23-e8dc6f37bb4bn%40googlegroups.com.

Reply via email to