安装GO语言环境之安装Visual Studio Code插件

作者:www.s0081.com

安装GO语言环境之安装Visual Studio Code插件。在安装Visual Studio Code插件的时候,由于谷歌的限制,在下载下列插件的时候会报错:

go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-find-references
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols

报错内容:

Fetching https://golang.org/x/tools/cmd/gorename?go-get=1
Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status
code 200)
get "golang.org/x/tools/cmd/gorename": found meta tag main.metaImport{Prefix:"go
lang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at h
ttps://golang.org/x/tools/cmd/gorename?go-get=1
get "golang.org/x/tools/cmd/gorename": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)

 

安装GO语言环境之安装Visual Studio Code插件。安装GO语言环境之安装Visual Studio Code插件。 

 

下面介绍如果绕过封锁去获取相应的插件:

 

md %GOPATH%srcgithub.comgolang
cd %GOPATH%srcgithub.comgolang
git clone https://github.com/golang/tools.git tools
md %GOPATH%srcgolang.orgxtools
xcopy /s /e %GOPATH%srcgithub.comgolangtools

 

前提是设置好 %GOPATH%

之后再执行以下操作:

go install github.com/nsf/gocode
go install sourcegraph.com/sqs/goreturns
go install github.com/golang/lint/golint
go install github.com/newhook/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/lukehoban/go-outline

 

 

可以参考下面的网址设置Visual Studio Code

本文由金沙城中心全部网址发布,转载请注明来源

关键词: