zl程序教程

您现在的位置是:首页 >  其它

当前栏目

could not find 'gopls

not &# 39 Find could
2023-09-27 14:22:02 时间

安装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
---------------------  
作者:yefengzhichen  
来源:CSDN  
原文:https://blog.csdn.net/yefengzhichen/article/details/90050921  
版权声明:本文为博主原创文章,转载请附上博文链接!