解決vscode中golang插件依賴安裝失敗問題
vscode中安裝ms-vscode.go
插件后可以開啟對go語言的支持,ms-vscode.go
插件需要依賴一些工具,安裝完成后提示
Installing github.com/nsf/gocode SUCCEEDED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/acroca/go-symbols FAILED
Installing golang.org/x/tools/cmd/guru FAILED
Installing golang.org/x/tools/cmd/gorename FAILED
Installing github.com/fatih/gomodifytags SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED
Installing github.com/josharian/impl FAILED
Installing github.com/rogpeppe/godef SUCCEEDED
Installing sourcegraph.com/sqs/goreturns FAILED
Installing golang.org/x/lint/golint FAILED
Installing github.com/cweill/gotests/... FAILED
Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED
8 tools failed to install.
由于網絡原因顽爹,一些依賴工具無法正常安裝贴浙,需要進行手動安裝.
以下為手動安裝的工具的步驟:
在
%GOPATH%\src\
目錄下罩驻,建立路徑golang.org\x
進入到
%GOPATH%\src\golang.org\x
兴使,下載需要工具的源碼git clone https://github.com/golang/tools.git tools
clone完成后米酬,會生成一個tools文件夾佃蚜,這樣工具所需要的源碼已經準備好了
-
進入到
%GOPATH%
下蝉揍,執(zhí)行go install github.com/ramya-rao-a/go-outline go install github.com/acroca/go-symbols go install golang.org/x/tools/cmd/guru go install golang.org/x/tools/cmd/gorename go install github.com/rogpeppe/godef go install github.com/sqs/goreturns go install github.com/cweill/gotests/gotests
單獨處理golint,golint的源碼位于
https://github.com/golang/lint
,進入%GOPATH%\src\golang.org\x
后執(zhí)行git clone https://github.com/golang/lint
下載golint需要的源碼進入到
%GOPATH%
下链峭,執(zhí)行go install github.com/golang/lint/golint
這樣,vscode的golang插件所依賴的工具安裝完成了又沾。