登录
首页 >  Golang >  Go问答

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

来源:stackoverflow

时间:2024-03-26 11:57:36 170浏览 收藏

使用 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知识!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>