2. vsCode 安装GoCode

1)安装gocode

打开命令提示符(以管理员身份打开),输入:

go get -u -v github.com/nsf/gocode

开始下载:

image 

下载完毕:

image

下载完成,查看D:\GoWorks目录,多了一个src\github.com\nsf\gocode路径,如下图:

image

雷同,通过命令行安装以下8个工具。

2)安装godef
go get -u -v github.com/rogpeppe/godef

image
3)安装golint
go get -u -v github.com/golang/lint/golint

image
4)安装go-find-references
go get -u -v github.com/lukehoban/go-find-references

image
5)安装go-outline
go get -u -v github.com/lukehoban/go-outline

image
6)安装goreturns
go get -u -v sourcegraph.com/sqs/goreturns

image
7)安装gorename
go get -u -v golang.org/x/tools/cmd/gorename

image
8)安装gopkgs
go get -u -v github.com/tpng/gopkgs

image
9)安装go-symbols
go get -u -v github.com/newhook/go-symbols

image

 

集成安装命令,拷贝到cmd窗口就可完成安装:

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

3、使用 Hello word

1)File-> Open Folder,现在工作目录:

image image

 

2)新建go文件

image

看看,智能提示出来了。

image

 

posted @ 2019-04-03 09:52  BK小鬼  阅读(3536)  评论(0编辑  收藏  举报