Thanks a log Amnon! :D
在2022年4月1日星期五 UTC+8 21:25:14 写道:
> Yes, this is the murky world of ANSI escape codes.
> Fortunately there are a whole load of libraries which do this for you...
> Try https://github.com/cheggaaa/pb
> or https://github.com/schollz/progressbar
> or
Yes, this is the murky world of ANSI escape codes.
Fortunately there are a whole load of libraries which do this for you...
Try https://github.com/cheggaaa/pb
or https://github.com/schollz/progressbar
or github.com/vardius/progress-go
On Friday, 1 April 2022 at 13:12:11 UTC+1 yan.z...@gmail.com
Got it:
package main
import(
"fmt"
"time"
)
func main() {
fmt.Printf("Hello")
time.Sleep(time.Second)
time.Sleep(time.Second)
fmt.Printf("\r")
fmt.Printf("World\n")
}
在2022年4月1日星期五 UTC+8 15:34:08 写道:
> You can use the ansi escape code if the target terminal supports it.
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