windows安裝vscode,配置golang環境
阿新 • • 發佈:2019-02-02
too vscode pkg 代碼 bus 包安裝 ati golang 安裝失敗
出現的問題:
進行如下命令進行目錄切換:
cd %GOPATH%\src\github.com\golang
我這裏的GOPATH是在D:\GoPath,大家這裏一定要註意些
如果src目錄下面沒有github.com\golang文件夾請自行創建
完成目錄切換後,開始下載插件包,在切換後的目錄下進入命令行界面,可以用git bash:
git clone https://github.com/golang/tools.git tools
當下載完成後,你會發現%GOPATH%\src\github.com\golang多了一個tools目錄
需要把tools目錄下的所有文件拷貝到%GOPATH%\src\golang.org\x\tools下,如果沒有自行創建。
這時我想偷個懶,再重新打開VSCode時,發現只有一個安裝包安裝失敗
這時可以轉換成手動安裝:
將目錄切換到GOPATH目錄下,執行相關的go install 命令
go get -u -v github.com/ramya-rao-a/go-outlinego get -u -v github.com/acroca/go-symbols go get -u -v github.com/mdempsky/gocode
go get -u -v github.com/rogpeppe/godef go get -u -v golang.org/x/tools/cmd/godoc go get -u -v github.com/zmb3/gogetdoc go get -u -v github.com/golang/lint/golint go get -u -v github.com/fatih/gomodifytags go get -u -v golang.org/x/tools/cmd/gorename go get -u -v sourcegraph.com/sqs/goreturns go get -u -v golang.org/x/tools/cmd/goimports go get -u -v github.com/cweill/gotests/... go get -u -v golang.org/x/tools/cmd/guru go get -u -v github.com/josharian/impl go get -u -v github.com/haya14busa/goplay/cmd/goplay go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct go get -u -v github.com/alecthomas/gometalinter gometalinter --install
windows安裝vscode,配置golang環境