-3
打開的文件可以說我有這樣的代碼:golang - 在一個空的bash窗口
package main
import (
"io/ioutil"
"fmt"
)
func check(err error) {
if err != nil {
panic(err)
}
}
func main() {
file, err := ioutil.ReadFile("test.txt")
check(err)
fmt.Print(string(file))
}
與
go run
運行時,它
我希望它在清除的bash窗口寫入。是否可以在不使用任何其他開放源代碼存儲庫的情況下這樣做?
在此先感謝。
你是什麼意思寫在一個清除的緩衝區? – jcbwlkr
我編輯了這個問題。 – Paul
[我怎樣才能清除Go中的終端屏幕?](http://stackoverflow.com/questions/22891644/how-can-i-clear-the-terminal-screen-in-go);和[我怎樣才能清除控制檯與golang在Windows?](http://stackoverflow.com/questions/19209425/how-i-clear-the-console-with-golang-in-windows) – icza