Debugging with dlv
Debug a particular function
dlv test github.com/DNSControl/dnscontrol/v5/pkg/diff2 -- -test.run Test_analyzeByRecordSet
^^^^^^^^^
Assumes you are in the pkg/diff2 directory.Debug an integration tests
dlv test github.com/DNSControl/dnscontrol/v5/integrationTest -- -test.v -test.run ^TestDNSProviders -verbose -profile BIND -start 7 -end 7If you are using VSCode, the equivalent configuration is:
"configurations": [
{
"name": "Debug Integration Test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/integrationTest",
"cwd": "${workspaceFolder}/integrationTest",
"envFile": "${workspaceFolder}/integrationTest/.env",
"args": [
"-test.v",
"-test.run",
"^TestDNSProviders",
"-verbose",
"-profile", "BIND",
"-start", "7",
"-end", "7"
],
"buildFlags": "",
"env": {},
"showLog": false,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
Debug the dnscontrol command
VSCode equivalent configuration is:
Debug helpers.js
Develop a function:
Debug a function within helpers.js (run from the root of the repository):
Last updated