代码: ```go package main import ( "fmt" "os" "time" ) func main() { fmt.Fprintf(os.Stdout, "%d%% [正在链接 https://github.com/xmge/gonote]\r",0) time.Sleep(1 * time.Second) for i := 1; i <= 100; i = i + 1 { fmt.Fprintf(os.Stdout, "%d%% [%s]\r",i,getS(i,"#") + getS(100-i," ")) time.Sleep(time.Second * 1) } } func getS(n int,char string) (s string) { for i:=1;i<=n;i++{ s+=char } return } ``` 效果: ![2018-12-19 11-36-16屏幕截图.png](https://static.studygolang.com/181219/a5c4726e05fe3f2e4d96c4cff55b2403.png) 关键点:`\r` [[了解\r]](https://stackoverflow.com/questions/15442292/golang-how-to-have-an-inplace-string-that-updates-at-stdout)