go 1.20rc1
goland 2022.2.3
无法进行debug
控制台提示
WARNING: undefined behavior - version of Delve is too old for Go version 1.20.-1 (maximum supported version 1.19)
或者没有变量调试,按照下面进行操作:
解决
克隆 git 存储库并构建:
$ git clone https://github.com/go-delve/delve
$ cd delve
$ go install github.com/go-delve/delve/cmd/dlv
或者,在 Go 版本 1.16 或更高版本上:
# Install the latest release:
$ go install github.com/go-delve/delve/cmd/dlv@latest
# Install at tree head:
$ go install github.com/go-delve/delve/cmd/dlv@master
或者如下克隆
git clone [https://github.com/go-delve/delve.git](https://github.com/go-delve/delve.git)
go install github.com/go-delve/delve/cmd/dlv@latest
在delve的项目目录下,{GOPATH}/bin
目录下生成dlv.exe 替换goland自带的dlv, 在{goland-install-path}\plugins\go\lib\dlv\windows
下