代码之家  ›  专栏  ›  技术社区  ›  BigBug

远程调试go rest终结点

  •  1
  • BigBug  · 技术社区  · 6 年前

    我是新的去和新的VScode。我也从未使用过Delve。我正在尝试设置远程调试,但似乎无法达到断点。

    我的项目宿主本地主机上的REST端点:8080。launch.json文件应该是什么样的,以便让delve附加和监听,以便我可以在REST端点上放置断点?目前,我有:

    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "remote",
            "remotePath": "",
            "port": 8080,
            "host": "127.0.0.1",
            "program": "${workspaceRoot}",
            "env": {},
            "args": [],
            "showLog": true
        }
    

    事先谢谢!

    1 回复  |  直到 6 年前
        1
  •  1
  •   VonC    6 年前

    This article 提到:


    Debugging Go Code with GDB “。

    Remote Debugging 他说:“这是一个很好的选择。”

    $ dlv debug --headless --listen=:2345 --log
    

    你的启动程序可以应用。