您的位置 首页 golang

Golang:Delve版本太低无法Debug


问题描述

今天把Go从1.12版本升到了1.14,然后发现在Goland进行Debug时就报错了。

Version of Delve is too old for this version of Go (maximum supported version 1.12, suppress this error with --check-go-version=false)
Golang:Delve版本太低无法Debug

环境说明

Goland 版本为 2019.2.1

go envset GOARCH=amd64set GOCACHE=C:UsersAdministratorAppDataLocalgo-buildset GOENV=C:UsersAdministratorAppDataRoaminggoenvset GOEXE=.exeset GOHOSTARCH=amd64set GOHOSTOS=windowsset GOOS=windowsset GOPATH=F:Goset GOPROXY=https://mirrors.aliyun.com/goproxy/set GOROOT=C:Goset GOSUMDB=sum.golang.orgset GOTOOLDIR=C:Gopkgtoolwindows_amd64set GCCGO=gccgoset AR=arset CC=gccset CXX=g++set CGO_ENABLED=1set CGO_CFLAGS=-g -O2set CGO_CXXFLAGS=-g -O2set CGO_FFLAGS=-g -O2set CGO_LDFLAGS=-g -O2set PKG_CONFIG=pkg-configset GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:UsersAdministratorAppDataLocalTempgo-build054006970=/tmp/go-build -gno-record-gcc-switches

分析

这是因为本地delve组件版本过低导致的,2019.2.1版本的Goland默认支持go 1.13

查看F:Go (GOPATH目录)目录下存在github.com/go-delve/delve/cmd/dlv,而且bin目录下也存在dlv.exe文件,用命令行执行 dlv.exe version得到的版本是1.2.1

解决办法

1. 更新dlv

因为本地已经存在,所以,需要用到-u参数,强制更新包以及依赖

go get -u github.com/go-delve/delve/cmd/dlv

注:如果get失败,可以直接去github用git下载github.com/go-delve/delve/cmd/dlv
然后命令行进入到下载好的目录,直接go build编译dlv,将编译好的dlv.exe复制到F:/Go/bin/目录下

2. 设置Goland

打开 Hele->Edit Customer Properties,若提示文件不存在,点击创建。然后在新加一行 dlv.path=F:/Go/bin/dlv.exe 重启就可以了

Golang:Delve版本太低无法Debug

文章来源:智云一二三科技

文章标题:Golang:Delve版本太低无法Debug

文章地址:https://www.zhihuclub.com/6831.shtml

关于作者: 智云科技

热门文章

评论已关闭

151条评论

  1. Pingback: goland debug是遇到问题,解决方法
  2. With regard to urinary problems the rain forests of West and Central Africa are busy with modern bioprospectors looking for native medicines to convert into the latest wonder drugs. Ukohjs – Cialis Finasteride Nausea Propecia comprar viagra en las palmas – Cialis Our study has limitations that limit its generalizability to other populations.

  3. Poly ADP ribose polymerase PARP cleavage and nucleosomal fragmentation were measured after 12 and 24 hours

  4. CrossrefMedlineGoogle Scholar 20 Sanderson JE, Chan WW, Hung YT, Chan SK, Shum IO, Raymond K, Woo KS

网站地图