Debug golang program in vscode

Basic config install delve use debug config template in vscode Debug with stdin input The default delve debug mod doesn’t support stdin input. To tackle this issue, use the method of launching a delve debug server and attach program to debug server instead. tasks.json { "tasks": [ { "label": "Delve debug server", "type": "shell", "command": "cd \"${fileDirname}\" && source /etc/profile && ~/go/bin/dlv debug --headless --listen=:2346 --api-version=2", "problemMatcher": [], "group": { "kind": "build", "isDefault": false } } ], "version": "2....

May 1, 2022 · 1 min · Andyliu