這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。https://golang.org/doc/code.htmlsrc contains Go source files,pkg contains package objects, andbin contains executable commands.The go tool builds source packages and installs the resulting binaries to the pkg and bin directories.需要先設定:The GOPATH specifies the location of your workspace. GOPATH must not be the same path as your Go installation.安裝下載https://golang.org/dl/如 https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gztar -C /usr/local/ -xzf go1.8.3.linux-amd64.tar.gzexport PATH=$PATH:/usr/local/go/bin GOROOT must be set when installing to a custom location. 所以最好安裝在/usr/local目錄下為什麼要使用 Go 語言?Go 語言的優勢在哪裡?部署簡單。我發現我花了四年時間錘鍊自己用 C 語言構建系統的能力,試圖找到一個規範,可以更好的編寫軟體。結果發現只是對 Go 的模仿。缺乏語言層面的支援,只能是一個拙劣的模仿。對於大多數後台應用情境,選擇Golang是極為明智的選擇。 如果你是C愛好者,強烈建議你學習和使用Go。Go可以調用C/C++程式你用來學89個C++進階特性的時間,估計已經用Go寫了64個開源項目了。