Go VS Code 調式常見問題處理

GO VS Code 調式配置

launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "go", "request": "launch", "mode": "debug", "remotePath": "", "port": 2345, "host": "127.0.0.1", "program": "${fileDirname}", "env": { "GOPATH":"D:\\項目目錄;D:\\項目目錄1;" }, "args": [], "showLog": true } ] }

 

Failded to continue:"Cannot find Delve debugger. Install from https://github.com/derekparker/delve & ensure it is in your "GOPATH/bin" or "PATH" 錯誤處理git

或VS Code 終端:go get github.com/derekparker/delve/cmd/dlvgithub

 

 

多項目調試

launch.json
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "remotePath": "",
            "port": 2345,
            "host": "127.0.0.1",
            "program": "${fileDirname}",
            "env": {
                "GOPATH":"E:\\GoFouxucPrivateRoomPorject\\"
            },
            "args": [],
            "showLog": true
        },
        {
            "name": "Launch2",
            "type": "go",
            "request": "launch2",
            "mode": "debug",
            "remotePath": "",
            "port": 2345,
            "host": "127.0.0.1",
            "program": "${fileDirname}",
            "env": {
                "GOPATH":"E:\\GoFouxucPrivateRoomPorject\\"
            },
            "args": [],
            "showLog": true
        }
相關文章
相關標籤/搜索