背景
新电脑mac m1
goland调试抛出异常
异常信息
第一次异常信息
could not launch process: can not run under Rosetta, check that the installed build of Go is right for your CPU architecture
原因是goland版本安装错了.
下载地址:https://www.jetbrains.com/zh-cn/go/download/#section=mac
.dmg选择 Apple Silicon
第二次异常信息
Cannot find the Delve executable for darwin/arm64. Specify the Delve location by adding 'dlv.path=/path/to/delve' in 'Help | Edit Custom
需要配置dlv.path,步骤如下
-
安装 darwin/arm64 版本go , 执行:brew install go ,我电脑安装最新版: go version go1.19 darwin/arm64
-
安装 Apple Silicon版本的Goland ,上面已经说过,我电脑安装的是 GoLand 2022.2.2
-
安装delve
git clone https://github.com/go-delve/delve
cd delve && make install
,- delve会安装在 ~/go/bin/dlv ,我本地:/Users/bj00195ml/go/bin/dlv
-
配置dlv,
-
打开Goland Help->Edit Custom VM Options. 添加
-Ddlv.path=/Users/bj00195ml/go/bin/dlv
。bj00195ml替换成你的 -
打开Goland Help->Edit Custom properties 添加
dlv.path=/Users/bj00195ml/go/bin/dlv
。bj00195ml替换成你的
-
- 重启Goland
标签:bin,bj00195ml,mac,goland,m1,dlv,path,go,delve From: https://www.cnblogs.com/zhangzhi19861216/p/16607229.html