macOS 10.12.1 Idea除錯Go程式遇到could not launch process: could not get thread count
我的Idea版本是2016.3,在macOS 10.12.1除錯Go程式會發現報錯:
could not launch process: could not get thread count
解決方案如下:
- 進入你的 $
GOPATH 目錄
- 建立資料夾:
$GOPATH/src/github.com/derekparker/
依次執行如下命令:
- cd $GOPATH/src/github.com/derekparker/
git clone https://github.com/derekparker/delve.git
cd delve
git fetch origin pull/665/head
git checkout FETCH_HEAD
CERT=dlv-cert make install
$ mv ~/Library/Application\ Support/IntelliJIdea2016.3/Go/lib/dlv/mac/dlv ~/Library/Application\ Support/IntelliJIdea2016.3/Go/lib/dlv/mac/dlv.orig
$ ln -s $GOPATH/bin/dlv ~/Library/Application\ Support/IntelliJIdea2016.3/Go/lib/dlv/mac/dlv
再嘗試使用IDEA除錯GO程式,成功!