操作步骤
-
安装/更新dlv,
go get -u github.com/derekparker/delve/cmd/dlv
-
修改Goland的配置,Help->Edit Custom Properties中增加新版dlv的路径配置:dlv.path=/path/go/bin/dlv
-
IDE右上角Edit Configurations配置一下项目的Go Build,如下图:
-
在编辑栏左侧边点击可以打断点,在编辑区右键菜单点击
Debug xxx