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

相关推荐
摇滚侠2 天前
IDEA 创建 Java 项目 手动整合 SSM 框架
java·ide·intellij-idea
何以解忧,唯有..2 天前
Go语言循环语句详解:for、range与循环控制
开发语言·算法·golang
踏着七彩祥云的小丑2 天前
Go学习第9天:并发编程 + 文件操作 + 正则表达式
学习·golang·正则表达式·go
JCGKS2 天前
Go `init` 函数:包初始化顺序到底是怎样的
golang·init·init执行顺序
摇滚侠2 天前
SpringMVC 入门到实战 RESTFul 49-55
java·开发语言·后端·spring·intellij-idea·restful
何以解忧,唯有..2 天前
Go语言中的const:常量声明与iota枚举详解
java·开发语言·golang
代码雕刻家2 天前
1.24.MySQL-idea中连接MySQL的基本操作
数据库·mysql·intellij-idea
星月IWJ2 天前
idea 工具整理
java·spring boot·intellij-idea
终将老去的穷苦程序员2 天前
IntelliJ IDEA 的安装教程
java·ide·intellij-idea
geovindu2 天前
go: Reactor Pattern
开发语言·后端·设计模式·golang·反应器模式