如何在 Visual Studio 代码中使用 Delve 调试器进行远程调试

How to remote debug with Delve debugger in Visual Studio Code

我已经问过了,得到了一个非常好的 用于使用 delve(golang 调试器)进行本地调试。

现在我正在尝试使用 VS Code 对 Delve 进行远程调试。

我有一个提到的示例应用 here, and further github linked to source code here。注意:调试项目在名为 debugging 的分支中。

你能做到吗?

我在 repo 中也有 created/opened 个问题。

以下有效:

  1. 删除 launch.json 中的第 3 行 "debugServer": 4711,"
  2. 将 launch.json 中的第 29 行“"host": “192.168.99.100” // Docker IP”更改为“127.0.0.1”。

我确信我以前试过这个,但显然不是同时进行的。 无论如何快乐走'幸运!