vscode的go插件
这款插件的特性包括:
• Colorization 代码着彩色
• Completion Lists 代码自动完成(使用gocode)
• Snippets 代码片段
• Quick Info 快速提示信息(使用godef)
• Goto Definition 跳转到定义(使用godef)
• Find References 搜索参考引用(使用go-find-references)
• File outline 文件大纲(使用go-outline)
• Workspace symbol search 工作区符号搜索(使用 go-symbols)
• Rename 重命名(使用gorename)
• Build-on-save 保存构建(使用go build和go test)
• Format 代码格式化(使用goreturns或goimports或gofmt)
• Add Imports 添加引用(使用 gopkgs)
• Debugging 调试代码(使用delve)
vscode默认会提示安装缺少的插件,但有些插件需要翻墙,需要手动安装。
不需要翻墙的可直接go get,否则需要手动下载对应的插件包,放到系统GOPATH/src下,
并建立对应的目录结构,执行go install。
go install github.com/nsf/gocode
go install github.com/rogpeppe/godef
go install github.com/zmb3/gogetdoc
go install github.com/golang/lint/golint
go install github.com/lukehoban/go-outline
go install sourcegraph.com/sqs/goreturns
go install golang.org/x/tools/cmd/gorename
go install github.com/tpng/gopkgs
go install github.com/newhook/go-symbols
go install github.com/cweill/gotests/...
go install golang.org/x/tools/cmd/guru
//如果需要在vscode中调试go程序,需要下载安装dlv
go install github.com/derekparker/delve/cmd/dlv
1)安装gocode
go get -u -v github.com/nsf/gocode
2)安装godef
go get -u -v github.com/rogpeppe/godef
3)安装golint
go get -u -v github.com/golang/lint/golint????
4)安装go-find-references
go get -u -v github.com/lukehoban/go-find-references
5)安装go-outline
go get -u -v github.com/lukehoban/go-outline
6)安装goreturns
go get -u -v sourcegraph.com/sqs/goreturns????
go get -u -v github.com/sqs/goreturns
7)安装gorename
go get -u -v golang.org/x/tools/cmd/gorename????
8)安装gopkgs
go get -u -v github.com/tpng/gopkgs
9)安装go-symbols
go get -u -v github.com/newhook/go-symbols????
集成安装:
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
•go-outline: go get -u -v github.com/ramya-rao-a/go-outline
•go-symbols: go get -u -v github.com/acroca/go-symbols
•gocode: go get -u -v github.com/nsf/gocode
•godef: go get -u -v github.com/rogpeppe/godef
•godoc: go get -u -v golang.org/x/tools/cmd/godoc
•gogetdoc: go get -u -v github.com/zmb3/gogetdoc
•golint: go get -u -v github.com/golang/lint/golint
•gomodifytags: go get -u -v github.com/fatih/gomodifytags
•gopkgs: go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs
•gorename: go get -u -v golang.org/x/tools/cmd/gorename
•goreturns: go get -u -v sourcegraph.com/sqs/goreturns
•gotests: go get -u -v github.com/cweill/gotests/...
•guru: go get -u -v golang.org/x/tools/cmd/guru
•impl: go get -u -v github.com/josharian/impl
To install the tools manually in the current GOPATH, just paste and run:
go get -u -v
github.com/ramya-rao-a/go-outline
github.com/acroca/go-symbols
github.com/nsf/gocode
github.com/rogpeppe/godef
golang.org/x/tools/cmd/godoc
github.com/zmb3/gogetdoc
github.com/golang/lint/golint
github.com/fatih/gomodifytags
github.com/uudashr/gopkgs/cmd/gopkgs
golang.org/x/tools/cmd/gorename
sourcegraph.com/sqs/goreturns
github.com/cweill/gotests/...
golang.org/x/tools/cmd/guru
github.com/josharian/impl