Fork me on GitHub

VS Code调试go语言程序,vscode调试golang

vscode如何调试golang,goweb?

编辑launch.json配置文件

 {
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}/server",
            "args": [
                "-test.run",
                // test function name
                // * can use reguler expression
                // * NOT include "Test"
                // * the first charactor MUST be small
                "bubblesort"
              ]
        }
    ]
}

注意 "program": "${workspaceFolder}/server" 这个值需要根据自己程序的位置自行调整

记录一下哈

posted @ 2022-02-10 14:28  秋刀鱼de滋味  阅读(257)  评论(0编辑  收藏  举报