使用Delve在VSCode上调试Go代码

huangapple go评论88阅读模式
英文:

Debugging GO on VSCode using Delve

问题

我想在VSCode编辑器上调试GoLang。在他们的文档中,他们说这是可能的。我正在按照以下链接中的说明安装IDE上的调试功能。
https://marketplace.visualstudio.com/items?itemName=lukehoban.Go

他们要求按照以下说明安装Delve
https://github.com/derekparker/delve/blob/master/Documentation/installation/windows/install.md

安装完成后,他们要求运行以下代码

$ mingw32-make install

但是出现了错误

mingw32-make: *** No rule to make target 'install'. Stop.

有人知道这是怎么回事吗?除了这些说明,还有其他变化吗?

英文:

I want to debug GoLang on VSCode editor. In their documentation they say it is possible. I am following the following Link to install the debugging features on the IDE.
https://marketplace.visualstudio.com/items?itemName=lukehoban.Go

And to install Delve they ask to follow these instructions
https://github.com/derekparker/delve/blob/master/Documentation/installation/windows/install.md

Once installation is completed they ask to run the following code
> $ mingw32-make install

But there is an error
> mingw32-make: *** No rule to make target 'install'. Stop.

Does anybody know whats wrong with this? Has anything changed other than these instructions?

答案1

得分: 5

我成功解决了这个问题。你不需要安装mingw。相反,运行以下代码,并确保在你的计算机的PATH变量中的任何目录中创建了dlv.exe。

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

我还写了一篇关于如何使用VSCode和Delve调试Golang的文章。如果你有兴趣,可以在这里阅读。

英文:

I managed to get this resolved. You don't want to install mingw for this. Instead run this code and make sure the dlv.exe which is created in any directory which is in your PATH variable in your computer.

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

I also did an writeup about debugging Golang using VSCode and Delve. If you are interested you can read it here.

答案2

得分: 1

从使用 git clone https://github.com/derekparker/delve 命令创建的目录中运行 mingw32-make install 命令。

英文:

Run mingw32-make install command from directory created by git clone https://github.com/derekparker/delve command.

huangapple
  • 本文由 发表于 2016年4月25日 15:38:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/36834557.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定