idea中debug Go程序报错error layer=debugger could not patch runtime.mallogc

一、问题场景

在idea中配置了Go编程环境,可以运行Go程序,但是无法debug,报错error layer=debugger could not patch runtime.mallogc: no type entry found, use 'types' for a list of valid types

二、解决方案

这是由于idea中使用的dlv.exe版本太老导致,直接在终端中执行如下命令安装最新版dlv.exe

bash 复制代码
go install github.com/go-delve/delve/cmd/dlv@latest

这会将dlv.exe安装到个人所设置的GOPATH目录下的bin目录中

打开idea的Help->Edit Custom Properties,添加一下dlv.exe的路径,然后重启idea即可


参考:https://stackoverflow.com/questions/75585793/version-of-delve-is-too-old-for-go-version-1-20-0-maximum-supported-version-1-1

相关推荐
七七&5566 小时前
2024年08月13日 Go生态洞察:Go 1.23 发布与全面深度解读
开发语言·网络·golang
java坤坤6 小时前
GoLand 项目从 0 到 1:第八天 ——GORM 命名策略陷阱与 Go 项目启动慢问题攻坚
开发语言·后端·golang
元清加油6 小时前
【Golang】:函数和包
服务器·开发语言·网络·后端·网络协议·golang
恋喵大鲤鱼9 小时前
Golang 后台技术面试套题 1
面试·golang
:-)14 小时前
idea配置maven国内镜像
java·ide·maven·intellij-idea
路多辛19 小时前
Golang database/sql 包深度解析(二):连接池实现原理
数据库·sql·golang
kgduu20 小时前
go资料汇总
golang
qq_三哥啊21 小时前
【IDEA】设置Debug调试时调试器不进入特定类(Spring框架、Mybatis框架)
spring·intellij-idea·mybatis
apocelipes1 天前
下划线字段在golang结构体中的应用
golang