could not find 'gopls

安装go tools

安装以上后用vim打开go代码,使用函数跳转时会出现:

E718: Funcref required
vim-go: could not find 'gopls'. Run :GoInstallBinaries to fix it

或者说guru等不存在的错误,这时按照提示在vim中执行GoInstallBinaries会出现:

Error downloading github.com/zmb3/gogetdoc
Error downloading github.com/stamblerre/gocode
...

下载不成功,原因是这里网站连不上,需要找资源下载来手动安装。
比较重要的模块是:guru/gopls 在使用时主要是提示这两个模块,因此先安装。
guru

1、建立路径:

mkdir -p $GOPATH/github.com/Go-zh/

2、 在$GOPATH/github.com/Go-zh/ 目录下执行

git clone https://github.com/Go-zh/tools.git

3、执行安装:

go install github.com/Go-zh/tools/cmd/guru
#以下模块也包含了,顺带一起安装
go install github.com/Go-zh/tools/cmd/goimports
go install github.com/Go-zh/tools/cmd/gorename

gopls

执行安装:

go install github.com/Go-zh/tools/cmd/gopls 
原文地址:https://www.cnblogs.com/enumx/p/12317619.html