vim-go:解决"gopls"找不到的问题

作者:佚名

时间:2024-03-26

来源:stackoverflow

浏览:170

为golang安装plug'fatih/vim-go'插件后,我遇到了一些错误步骤:使用vim打开.go文件时出现错误:vim-go:couldnotfind'gopls'.run:goinstallbinariestofixitvim-go:couldnotdetermineappropriateworkingdirectoryforgoplus在执行:goinstallbinaries时,我收到更多错误,例如:vim

使用 vim-go 插件时,用户在 Windows 10 上遇到“gopls”找不到的问题。执行 :goinstallbinaries 命令后,出现“golang.org/x/tools/cmdfuru@master”和“golang.org..goplus@latest”等多个安装错误。在检查 $path 变量后,发现路径正确,但 golang 在 cmd 或 PowerShell 中可以正常工作。

问题内容

为 golang 安装 plug 'fatih/vim-go' 插件后,我遇到了一些错误

步骤: 使用 vim 打开 .go 文件时出现错误:

vim-go: could not find 'gopls' . run :goinstallbinaries to fix it
vim-go: could not determine appropriate working directory for go plus

在执行 :goinstallbinaries 时,我收到更多错误,例如:

vim-go: guru not found. instaling golang.org..guru@master to folder C:\Users\*MYPC*\go\bin\
vim-go: Error instaling golang.org/x/tools/cmdfuru@master: The system cannot find the path specified.
vim-go: goplus not found. instaling golang.org..goplus@latest to folder C:\Users\*MYPC*\go\bin\
vim-go: Error instaling golang.org..goplus@latest: The system cannot find the path specified.
.
.
.
it does that 8 more times with godef,motion,errcheck,dlv,iferr,golint...

当我在 vim 中执行 :echo $path 时,我有 c:\users*mypc*\go\bin\

我在 windows 10 上运行 gvim

cmd 或 powershell 中的 golang 工作正常...


解决方案


mac 版已解决

brew install gopls

好了,本文到此结束,带大家了解了《vim-go:解决"gopls"找不到的问题》,希望本文对你有所帮助!关注golang学习网公众号,给大家分享更多Golang知识!

本文内容来源于互联网,如有侵权请联系删除。

相关文章

更多

热门专题

更多
返回顶部