首先你要正确地安装了插件。
环境
Windows 10, GO 1.15
GOROOT=c:\go
GOPATH=E:\OneDrive\code\go
问题描述
如果我们设置GO111MODULE环境变量,其值为on时自动补全很慢,其值为off时补全正常。
image.png
(说明:必须要按照在图片里那样设置环境变量,不要运行命令行set; 每次改变变量需要重启VSCode)
gomod肯定不能关了,怎么解决呢?
解决方法
go的自动补全靠的时gocode,我们可以gocode -debug查看偏移,自动补全正常时偏移小于1ms,设置为on时偏移有3秒
很自然地我们去GitHub看看项目
gocode
人家直接写着:
You should have a correctly installed Go compiler environment and
your personal workspace ($GOPATH). If you have no idea
what $GOPATH is, take a look here
(http://golang.org/doc/code.html). Please make sure that
your $GOPATH/bin is available in your $PATH. This is
important, because most editors assume that g