Golang debugging in VSCode with Arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Launch", | |
"type": "go", | |
"request": "launch", | |
"mode": "debug", | |
"remotePath": "", | |
"port": 2345, | |
"host": "127.0.0.1", | |
"program": "${workspaceRoot}/cmd/traefik", | |
"env": {}, | |
// The -- here is key, telling delve to pass arguments after it to your code | |
"args": ["--", "-c", "config.lgpriv.toml"], | |
// This controls the Working directory the code runs in, as my config.lgpriv.toml in my root | |
// I want the working dir to be the workspace root | |
"cwd": "${workspaceRoot}", | |
"showLog": true | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment