Golang:Delve版本太低無法Debug

問題描述

最近把Golang升級到了1.14,突然發現Goland編輯器沒法Debug調試程序了,會報出如下錯誤:

Version of Go is too old for this version of Delve (minimum supported version 1.13, suppress this error with --check-go-version=false)

解決方法

  • 首先,更新本機的delve組件(直接打開cmd操作,不要在項目內)
go get github.com/go-delve/delve/cmd/dlv

如果操作有問題,可以參看作者的文檔:https://github.com/derekparker/delve/blob/master/Documentation/installation/windows/install.md

  • 然後,找到下載的delve,默認存放的地址是:%GOROOT%/bin/delve/dlv.exe

  • 設置Goland

  1. 依次打開:Help->Edit Customer Properties;若提示文件不存在,點擊創建即可。
  2. 在文件中新增:dlv.path=你的dlv路徑(windows的路徑需要轉義)
  • 最後重啓Goland即可(剛配置好後的第一次重啓會比較慢)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章