Goland的Debug不兼容旧版本Go解决方案

844 阅读1分钟

因为公司代码需要使用旧版本的Go,但与新版本的Goland不兼容,会导致以下问题:

Go 1.16.1 is not supported by the debugger. Please update to Go 1.19.0 or newer.

image.png

解决方式:

自己对 dlv 进行编译打包

git clone https://github.com/go-delve/delve.git
cd delve/cmd/dlv
git checkout v1.7.1
go build
go install

然后在 Goalnd 选择 Help > Edit Custom Properties

image.png

配置完成之后重启 Goland 即可。