首先推薦一下兩個網址:html
比較不錯的博客:http://www.cnblogs.com/zsy/p/5223957.htmlgit
在下載代碼時,golang.org/x/tools代碼下載不了,可使用http://www.golangtc.com/download/package解決 github
===========================================================golang
一、下面幾個因爲不依賴golang.org/x/tools,因此能夠正常下載ide
go get -u -v github.com/nsf/gocodefetch
go get -u -v github.com/rogpeppe/godefspa
go get -u -v github.com/lukehoban/go-find-references
調試
go get -u -v githbu.com/tpng/gopkgscode
下載完成以後,能夠正常在GOBIN下生成可執行文件orm
gocode.exe
godef.exe
go-find-references.exe
gopkgs.exe
二、若是想從github上下載golang.org/x/tools,能夠在git上執行
go get -u -v github.com/golang/tools
下載成功以後把tools剪切到src/golang.org/x目錄下
三、在git中執行
go get -u -v github.com/golang/lint/golint
執行過程當中會提示
https fetch failed: Get https://golang.org/x/tools/go/gcimporter15?go-get=1: net/http: TLS handshake timeout
不用理它,執行成功後會在GOBIN下生成golint.exe
同理:
go get -u -v github.com/lukehoban/go-outline
go get -u -v github.com/newhook/go-symbols
四、若是想從github上下載sourcegraph.com/sqs/goreturns,能夠在git上執行
go get -u -v github.com/sqs/goreturns
下載成功以後把sqs/goreturns剪切到src/sourcegraph.com/目錄下,再執行
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
此時在GOBIN路徑下有了以下幾個exe文件:
gorename
goreturns
go-symbols
go-outline
golint
gopkgs
go-find-references
gocode
godef
五、而後搞一下配置
文件 > 首選項 > 用戶設置
{
"files.autoSave": "onFocusChange",
"go.goroot": "D:/Go",
"go.gopath": "D:/Go/bin",
"go.formatTool": "goreturns"
}
這時候寫代碼就爽歪歪了 :)
六、然並卵,調試沒有鳥用,由於少dlv.exe,在git上執行下面命令吧
go get -v -u github.com/peterh/liner github.com/derekparker/delve/cmd/dlv
通過漫長的等待,會在GOBIN下生成dlv.exe
七、寫個demo調試下吧
在GOPATH路徑下建立src\omgs目錄,在omgs下建立demo.go文件,寫點代碼而後打個斷點,F5調試,一切很酸爽。
===========================================================
作個有愛心的人:
一、若是各位在搭建環境的過程當中遇到問題能夠隨時與我交流,說不定能夠把這一章節錄個視頻;
二、爲了方便懶人,我本想把生成的exe上傳到51CTO下載中心,但因爲文件比較大,有須要的直接聯繫我吧;
請叫我雷鋒~