Golang:Delve版本太低无法Debug

问题描述

最近把Golang升级到了1.14,突然发现Goland编辑器没法Debug调试程序了,会报出如下错误:

Version of Go is too old for this version of Delve (minimum supported version 1.13, suppress this error with --check-go-version=false)

解决方法

  • 首先,更新本机的delve组件(直接打开cmd操作,不要在项目内)
go get github.com/go-delve/delve/cmd/dlv

如果操作有问题,可以参看作者的文档:https://github.com/derekparker/delve/blob/master/Documentation/installation/windows/install.md

  • 然后,找到下载的delve,默认存放的地址是:%GOROOT%/bin/delve/dlv.exe

  • 设置Goland

  1. 依次打开:Help->Edit Customer Properties;若提示文件不存在,点击创建即可。
  2. 在文件中新增:dlv.path=你的dlv路径(windows的路径需要转义)
  • 最后重启Goland即可(刚配置好后的第一次重启会比较慢)

猜你喜欢

转载自blog.csdn.net/wuhualong1314/article/details/106795817