Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Golang debugging in VSCode with Arguments
"version": "0.2.0",
"configurations": [
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "",
"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