让你成功安装vscode中go的相关插件
注意:该演示环境是windows环境,linux和mac环境操作思路一样
vscode中有很多go的相关插件,非常好用如下:
gocode
gopkgs
go-outline
go-symbols
guru
gorename
gomodifytags
goplay
impl
godef
goreturns
golint
gotests
dlv
但是由于各种原因,这些插件无法安装,甚至你翻墙之后发现也还是无法安装,加上最近翻墙被限制的这么严格,所以总结了如下方法,让你在不翻墙的情况下还能将这些插件安装成功,下图是我直接通过vscode安装提示的错误:
貌似运气还不错,还安装成功了几个,但是大部分还是没有安装成功,下面是详细的安装日志:
Installing 14 tools at D:\go_project\bin gocode gopkgs go-outline go-symbols guru gorename gomodifytags goplay impl godef goreturns golint gotests dlv 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 github.com/golang/lint/golint FAILED Installing github.com/cweill/gotests/... FAILED Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED 8 tools failed to install. go-outline: Error: Command failed: D:\Go\bin\go.exe get -u -v github.com/ramya-rao-a/go-outline github.com/ramya-rao-a/go-outline (download) Fetching https://golang.org/x/tools/go/buildutil"golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil"golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil"golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil"golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil"golang.org/x/tools/cmd/guru" (https fetch: Get https://golang.org/x/tools/cmd/guru"golang.org/x/tools/cmd/guru" (https fetch: Get https://golang.org/x/tools/cmd/guru"golang.org/x/tools/cmd/gorename" (https fetch: Get https://golang.org/x/tools/cmd/gorename"golang.org/x/tools/cmd/gorename" (https fetch: Get https://golang.org/x/tools/cmd/gorename"golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports"golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports"sourcegraph.com/sqs/goreturns": found meta tag get.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns"golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports"sourcegraph.com/sqs/goreturns": found meta tag get.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns"golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports"golang.org/x/tools/go/gcexportdata" (https fetch: Get https://golang.org/x/tools/go/gcexportdata"golang.org/x/tools/go/gcexportdata" (https fetch: Get https://golang.org/x/tools/go/gcexportdata"golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports"golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports"color: #ff0000">解决方法关于go开发目录的结构这里不做过多解释,之前已经说过了
进行如下命令进行目录切换:
cd %GOPATH%\src\github.com\golang
我这里的GOPATH是在D:\go_project
如果src目录下面没有github.com\golang请自行创建完成目录切换后,开始下载插件包:
git clonehttps://github.com/golang/tools.gittools
当下载完成后,你会发现%GOPATH%\src\github.com\golang多了一个tools目录
需要把tools目录下的所有文件拷贝到%GOPATH%\src\golang.org\x\tools下,如果没有自行创建
当然如果你是windows环境,如果你当前是在%GOPATH%\src\golang.org\x\tools
目录下,你可以直接使用如下命令进行拷贝:
xcopy /s /e %GOPATH%\src\github.com\golang\tools
关于这个命令的使用可以具体百度查看,如果对该命令不熟悉就手动拷贝,直接将你下载的tools目录下的所有文件拷贝到%GOPATH%\src\golang.org\x\tools目录下经过多次测试,插件中有几个其实不用翻墙或其他方法就可以安装成功:
github.com/nsf/gocode
github.com/uudashr/gopkgs/cmd/gopkgs
github.com/fatih/gomodifytags
github.com/haya14busa/goplay/cmd/goplay
github.com/derekparker/delve/cmd/dlv下面安装无法安装的插件
开始安装:
切换到GOPATH目录下,执行相关的go install 命令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
这样vscode下go开发需要安装的插件都已经安装成功
总结
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
- 黄乙玲1999-无字的情批[台湾首版][WAV+CUE]
- 何超仪.1996-何家淑女(EP)【华星】【WAV+CUE】
- 娃娃.1995-随风【滚石】【WAV+CUE】
- 林俊吉.2007-林俊吉【美华影音】【WAV+CUE】
- 梁静茹《勇气》滚石首版[WAV+CUE][1.1G]
- 刘若英《听说》[WAV+CUE][1.1G]
- 林忆莲《不如重新开始》 24K金 MQA 2022 再版[1.1G]
- 曾庆瑜1991-女人主意[派森][WAV+CUE]
- 江智民2024-《写给海洋HQ》头版限量编号[WAV+CUE]
- 谭咏麟2024《暴风女神Lorelei》头版限量编号MQA-UHQCD[WAV+CUE]
- 群星.2003-滚石黄金十年系列33CD【滚石】【WAV+CUE】
- 萧亚轩.2008-3面夏娃【维京】【WAV+CUE】
- 唐娜.1989-那年情人节好冷【喜玛拉雅】【WAV+CUE】
- 赵传《赵传奇》 滚石SACD系列 SACD限量版[ISO][1.1G]
- 黄龄《痒》天韵文化[WAV+CUE][1G]