VSCode安裝go語言外掛程式,安裝失敗的問題

來源:互聯網
上載者:User

vscode 安裝外掛程式一直失敗,以下為網上找到的方法,親測可用。
轉自:https://blog.csdn.net/yo_oygo/article/details/79065966

在安裝go外掛程式時,會自動更新很多依賴庫檔案,都是從Github更新下來,但是因為Github的檔案中,多有應用go官網中的檔案,導致,因為網路緣故,不能直接下載,導致安裝失敗,如下:

Installing github.com/nsf/gocode SUCCEEDEDInstalling github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDEDInstalling github.com/ramya-rao-a/go-outline FAILEDInstalling github.com/acroca/go-symbols FAILEDInstalling golang.org/x/tools/cmd/guru FAILEDInstalling golang.org/x/tools/cmd/gorename FAILEDInstalling github.com/fatih/gomodifytags SUCCEEDEDInstalling github.com/haya14busa/goplay/cmd/goplay SUCCEEDEDInstalling github.com/josharian/impl FAILEDInstalling github.com/rogpeppe/godef SUCCEEDEDInstalling sourcegraph.com/sqs/goreturns FAILEDInstalling github.com/golang/lint/golint FAILEDInstalling github.com/cweill/gotests/... FAILEDInstalling github.com/derekparker/delve/cmd/dlv SUCCEEDED 8 tools failed to install.

這些失敗的庫,不是沒有下載下來,而是以來的檔案在go官網上,導致失敗。以下為解決辦法,

1、在%GOPATH%\src\ 目錄下,建立golang.org 檔案夾,並再建立x檔案夾。 目錄為 "%GOPATH\src\golang.org\x"

2、完成目錄切換後,開始下載外掛程式包:
git clone https://github.com/golang/tools.git tools

3、執行完以後,會多一個tools檔案夾。

4、開啟vsCode終端,切換到 終端,進入“%GOPATH”目錄,執行

go install github.com/ramya-rao-a/go-outlinego install github.com/acroca/go-symbolsgo install golang.org/x/tools/cmd/gurugo install golang.org/x/tools/cmd/gorenamego install github.com/josharian/implgo install github.com/rogpeppe/godefgo install github.com/sqs/goreturnsgo install github.com/golang/lint/golintgo install github.com/cweill/gotests/gotestsgo install github.com/ramya-rao-a/go-outlinego install github.com/acroca/go-symbolsgo install golang.org/x/tools/cmd/gurugo install golang.org/x/tools/cmd/gorenamego install github.com/josharian/implgo install github.com/rogpeppe/godefgo install github.com/sqs/goreturnsgo install github.com/golang/lint/golintgo install github.com/cweill/gotests/gotests

按此方法,可以安裝成功。

參考博文:

http://www.pythonsite.com/?p=429

http://blog.csdn.net/langzi7758521/article/details/51313521

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.