vscode golint 安裝失敗怎么辦?
問題源起:
因為國內的網絡屏蔽,golang.org被和諧,又趕上7.1,雙重力度的和諧社會,各種FQ無解,故有了下文。
解決方案概述:
到github下載go tools 和 golint 的源碼到本地目錄,用go install 命令安裝即可。
推薦教程:vscode教程
具體方法:
1、在%GOPATH%src 目錄下,建立golang.org 文件夾,并再新建x文件夾。? 目錄為 “%GOPATHsrcgolang.orgx”
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/cweill/gotests/gotests
<span><strong>繼續安裝golint</strong> 在cmd中切換到“GOPATH”目錄,執行?git?clone?https://github.com/golang/lint.git,將glint也下載到本地 復制%GOPATH%srcgithub.comgolanglint目錄到%GOPATH%srcgolang.orgx,不復制源碼不同意,算了,復制 執行:go?install?golang.orgxlintgolint,安裝完畢</span>
<strong><span>至此,全部go插件都安裝完畢,重啟vscode,看效果,不會有提示再彈出了</span></strong>
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦