我想打開Web瀏覽器:我如何啓動一個進程,是不是在進入一個文件(例如,打開一個網頁)
c, err := exec.Command("http://localhost:4001").Output()
if err != nil {
fmt.Printf("ERROR: %v, %v\n",err,c)
} else {
fmt.Printf("OK:%v\n",c)
}
,我得到的錯誤
ERROR: exec: "http://localhost:4001": file does not exist
編輯:我想達到什麼是相同的Windows和C#當你這樣做:
Process.Start("http://localhost:4001")
有了它一個默認瀏覽器的新實例將啓動,顯示URL
有沒有人想出瞭如何在Mac,Android等中做到這一點? – RoboTamer
請參閱[這裏](https://code.google.com/p/go-tour/source/browse/gotour/local.go#197) –