其他分享
首页 > 其他分享> > Go——vscode调试go语言

Go——vscode调试go语言

作者:互联网

Mac机下执行命令

更改代理,安装库

go env
export GOPROXY=https://goproxy.io,direct go get -v github.com/go-delve/delve/cmd/dlv go get -v github.com/ramya-rao-a/go-outline go get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs

 

vscode的launch.json文件

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "test_go",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceFolder}/src/test.go"
        },
        {
            "name": "gateway",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "cwd":"${workspaceFolder}/src",
            "program": "${workspaceFolder}/src/main.go",
            "env": {},
            "args": []
        }
    ]
}

 

调试效果

 

标签:src,workspaceFolder,get,vscode,launch,go,Go,com
来源: https://www.cnblogs.com/xingchong/p/15904078.html