vscode默认会提示安装缺少的插件,但有些插件需要翻墙,需要手动安装。
不需要翻墙的可直接go get,否则需要手动下载对应的插件包,放到系统GOPATH/src下,
并建立对应的目录结构,执行go install
go install http://github.com/nsf/gocode
go install http://github.com/rogpeppe/godef
go install http://github.com/zmb3/gogetdoc
go install http://github.com/golang/lint/golint
go install http://github.com/lukehoban/go-outline
go install http://sourcegraph.com/sqs/goreturns
go install http://golang.org/x/tools/cmd/gorename
go install http://github.com/tpng/gopkgs
go install http://github.com/newhook/go-symbols
go install http://github.com/cweill/gotests/...
go install http://golang.org/x/tools/cmd/guru
//如果需要在vscode中调试go程序,需要下载安装dlv
go install http://github.com/derekparker/delve/cmd/dlv
1)安装gocode
go get -u -v http://github.com/nsf/gocode
2)安装godef
go get -u -v http://github.com/rogpeppe/godef
3)安装golint
go get -u -v http://github.com/golang/lint/golint????
4)安装go-find-references
go get -u -v http://github.com/lukehoban/go-find-references
5)安装go-outline
go get -u -v http://github.com/lukehoban/go-outline
6)安装goreturns
go get -u -v http://sourcegraph.com/sqs/goreturns????
go get -u -v http://github.com/sqs/goreturns
7)安装gorename
go get -u -v http://golang.org/x/tools/cmd/gorename????
8)安装gopkgs
go get -u -v http://github.com/tpng/gopkgs
9)安装go-symbols
go get -u -v http://github.com/newhook/go-symbols????
集成安装:
go get -u -v http://github.com/nsf/gocode
go get -u -v http://github.com/rogpeppe/godef
go get -u -v http://github.com/golang/lint/golint
go get -u -v http://github.com/lukehoban/go-find-references
go get -u -v http://github.com/lukehoban/go-outline
go get -u -v http://sourcegraph.com/sqs/goreturns
go get -u -v http://golang.org/x/tools/cmd/gorename
go get -u -v http://github.com/tpng/gopkgs
go get -u -v http://github.com/newhook/go-symbols
-----------------------------------------------------------
安装失败则是需要fq
使用go mod 代理来安装
执行下面俩句
重启vscode ,继续安装。ok。
Installing 17 tools at C:\Users\admin\go\bin in module mode.
gocode
gopkgs
go-outline
go-symbols
guru
gorename
gotests
gomodifytags
impl
fillstruct
goplay
godoctor
dlv
gocode-gomod
godef
goreturns
golint
Installing http://github.com/mdempsky/gocode (C:\Users\admin\go\bin\gocode.exe) SUCCEEDED
Installing http://github.com/uudashr/gopkgs/v2/cmd/gopkgs (C:\Users\admin\go\bin\gopkgs.exe) SUCCEEDED
Installing http://github.com/ramya-rao-a/go-outline (C:\Users\admin\go\bin\go-outline.exe) SUCCEEDED
Installing http://github.com/acroca/go-symbols (C:\Users\admin\go\bin\go-symbols.exe) SUCCEEDED
Installing http://golang.org/x/tools/gopls (C:\Users\admin\go\bin\gopls.exe) SUCCEEDED
All tools successfully installed. You are ready to Go :).
Installing http://golang.org/x/tools/cmd/guru (C:\Users\admin\go\bin\guru.exe) SUCCEEDED
Installing http://golang.org/x/tools/cmd/gorename (C:\Users\admin\go\bin\gorename.exe) SUCCEEDED
Installing http://github.com/cweill/gotests/... (C:\Users\admin\go\bin\gotests.exe) SUCCEEDED
Installing http://github.com/fatih/gomodifytags (C:\Users\admin\go\bin\gomodifytags.exe) SUCCEEDED
Installing http://github.com/josharian/impl (C:\Users\admin\go\bin\impl.exe) SUCCEEDED
Installing http://github.com/davidrjenni/reftools/cmd/fillstruct (C:\Users\admin\go\bin\fillstruct.exe) SUCCEEDED
Installing http://github.com/haya14busa/goplay/cmd/goplay (C:\Users\admin\go\bin\goplay.exe) SUCCEEDED
Installing http://github.com/godoctor/godoctor (C:\Users\admin\go\bin\godoctor.exe) SUCCEEDED
Installing http://github.com/go-delve/delve/cmd/dlv (C:\Users\admin\go\bin\dlv.exe) SUCCEEDED
Installing http://github.com/stamblerre/gocode (C:\Users\admin\go\bin\gocode-gomod.exe) SUCCEEDED
Installing http://github.com/rogpeppe/godef (C:\Users\admin\go\bin\godef.exe) SUCCEEDED
Installing http://github.com/sqs/goreturns (C:\Users\admin\go\bin\goreturns.exe) SUCCEEDED
Installing http://golang.org/x/lint/golint (C:\Users\admin\go\bin\golint.exe) SUCCEEDED
All tools successfully installed. You are ready to Go :).