VSCode安裝go語言開發環境,go外掛程式問題解決

來源:互聯網
上載者:User

標籤:開發   gopkg   切換   site   自動更新   selector   pid   tag   oca   

 

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

 

  1.  Installing github.com/nsf/gocode SUCCEEDED
  2.  Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
  3.  Installing github.com/ramya-rao-a/go-outline FAILED
  4.  Installing github.com/acroca/go-symbols FAILED
  5.  Installing golang.org/x/tools/cmd/guru FAILED
  6.  Installing golang.org/x/tools/cmd/gorename FAILED
  7.  Installing github.com/fatih/gomodifytags SUCCEEDED
  8.  Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED
  9.  Installing github.com/josharian/impl FAILED
  10.  Installing github.com/rogpeppe/godef SUCCEEDED
  11.  Installing sourcegraph.com/sqs/goreturns FAILED
  12.  Installing github.com/golang/lint/golint FAILED
  13.  Installing github.com/cweill/gotests/... FAILED
  14.  Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED
  15.   
  16.  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-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/josharian/impl

go install github.com/rogpeppe/godef

go install github.com/sqs/goreturns

go install github.com/golang/lint/golint

go install github.com/cweill/gotests/gotests

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/josharian/impl

go install github.com/rogpeppe/godef

go install github.com/sqs/goreturns

go install github.com/golang/lint/golint

go install github.com/cweill/gotests/gotests

 

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

參考博文:

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

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

VSCode安裝go語言開發環境,go外掛程式問題解決

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.