how to debug revel framework(golang) application in visual studio code(vscode)
Asked Answered
E

1

3
{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "go",
        "request": "attach",
        "mode": "debug",
        "remotePath": "",
        "port": 2345,
        "host": "127.0.0.1",
        "program": "revel.exe",
        "env": {},
        "args": [],
        "showLog": true
    },

]

}

how to debug revel framework(golang) application in visual studio code(vscode) how to write the configuration file(launch.json)

Electrotonus answered 15/12, 2016 at 18:56 Comment(1)
Is this a question?Embarrassment
W
0

Here are the steps to debug a revel framework (golang) app in vscode.

  1. Import revel project folder into vscode
  2. Edit ~/.vscode/launch.json so that it looks like the following: (replace values in <> with values for your own local env.

{ "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "go", "request": "launch", "remotePath": "", "port": 2345, "host": "127.0.0.1", "mode": "debug", "program": "${workspaceRoot}/app/tmp/", "env": {}, "args": ["-importPath", "<project folder name>", "-srcPath", "C:\\Users\\<username>\\go\\src", "-runMode", "dev"] } ] }

Note that -importPath should be the directory (relative to $GOPATH\src where your project lives)

Note that the value for -srcPath should match your $GOPATH\src directory (I'm running on Windows)

Once your launch.json is set up as so, you can start the app in deb mode and put breakpoints wherever you wish.

enter image description here

Wizen answered 18/6, 2019 at 21:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.