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

相关推荐
百***07183 小时前
IDEA+Docker一键部署项目SpringBoot项目
spring boot·docker·intellij-idea
bemyrunningdog4 小时前
IntelliJ IDEA导出WAR包全指南
java·ide·intellij-idea
HotCoffee-GPS7 小时前
Golang学习笔记:定时crontab
golang
怪兽20149 小时前
PyCharm如何像其他idea软件跨行选择文本
ide·pycharm·intellij-idea
q***188413 小时前
搭建Golang gRPC环境:protoc、protoc-gen-go 和 protoc-gen-go-grpc 工具安装教程
开发语言·后端·golang
码上淘金1 天前
在 YAML 中如何将 JSON 对象作为字符串整体赋值?——兼谈 Go Template 中的 fromJson 使用
java·golang·json
小生凡一1 天前
图解|Go语言实现 Agent|LLM+MCP+RAG
开发语言·后端·golang
青鱼入云1 天前
IDEA源码阅读神器-Diagram工具
java·ide·intellij-idea
pipip.1 天前
Go原生高性能内存网关IMS,比Redis更快
开发语言·redis·golang
Lisonseekpan1 天前
IntelliJ IDEA 快捷键全解析与高效使用指南
java·ide·后端·intellij-idea