package mainimport ( "fmt" "strconv" "strings" "time")func main() { for i := 0; i <= 50; i++ { time.Sleep(100 * time.Millisecond) h := "" if 0 == i || i == 50 { h = strings.Repeat("=", i) + strings.Repeat(" ", 50-i) } else { h = strings.Repeat("=", i-1) + strings.Repeat(">", 1) + strings.Repeat(" ", 50-i) } fmt.Print("\r" + "[" + h + "]" + strconv.Itoa(i*2) + "%") } fmt.Println("OK!")}