23

go升级后vscode调试debug失效Version of Delve is too old for this version of Go (m...

 4 years ago
source link: https://studygolang.com/articles/27906
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

过程一

因为dlv的版本不支持的原因,重新下一个即可

go get github.com/go-delve/delve/cmd/dlv

已经有了就更新一下即可

go get -u github.com/go-delve/delve/cmd/dlv

如果已经成功就不需要继续了

过程二

中间可能还会有一个问题,就是包的下载问题

go get提示error: ...is not using a known version control system

错误提示代码

go get -v github.com/go-delve/delve/cmd/dlv

package golang.org/x/tools/go/gcexportdata: directory "E:\go\golang\src\golang.org\x\tools\go\gcexportdata" is not using a known version control system

这个原因是github.com/go-delve/delve/cmd/dlv 包直接下载的zip压缩包文件,修改文件名中-master因此没有加入到git版本控制系统中

所以报了这个错误

正确的方法:

1. 先从复制项目地址 github.com/go-delve/delve/cmd/dlv

2. 使用gitbash进入到需要放置此代码的位置

3. 使用 git clone github.com/go-delve/delve/cmd/dlv

这时候,执行debug调试的时候,他可能会提示你需要安装,右下角会出现一个提示你install,直接点击这个install,安装完成即可

Bfe2Yjz.png!web

image.png


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK