File tree Expand file tree Collapse file tree 1 file changed +39
-3
lines changed
documentation/advanced-features Expand file tree Collapse file tree 1 file changed +39
-3
lines changed Original file line number Diff line number Diff line change 11## Debugger
22
3- Test a particular function:
3+ ### Debug a particular function:
44
55``` shell
66dlv test github.com/StackExchange/dnscontrol/v4/pkg/diff2 -- -test.run Test_analyzeByRecordSet
77 ^^^^^^^^^
88 Assumes you are in the pkg/diff2 directory.
99```
1010
11- Debug the integration tests:
11+ ### Debug an integration tests:
1212
1313``` shell
1414dlv test github.com/StackExchange/dnscontrol/v4/integrationTest -- -test.v -test.run ^TestDNSProviders -verbose -profile BIND -start 7 -end 7
@@ -18,12 +18,15 @@ If you are using VSCode, the equivalent configuration is:
1818
1919```
2020 "configurations": [
21+
2122 {
2223 "name": "Debug Integration Test",
2324 "type": "go",
2425 "request": "launch",
2526 "mode": "test",
2627 "program": "${workspaceFolder}/integrationTest",
28+ "cwd": "${workspaceFolder}/integrationTest",
29+ "envFile": "${workspaceFolder}/integrationTest/.env",
2730 "args": [
2831 "-test.v",
2932 "-test.run",
@@ -39,5 +42,38 @@ If you are using VSCode, the equivalent configuration is:
3942 "buildFlags": "",
4043 "env": {},
4144 "showLog": true
42- },
45+ }
46+
47+ ]
48+ }
49+
50+ ```
51+
52+ ### Debug the ` dnscontrol ` command
53+
54+ ``` shell
55+ dlv debug --wd /path/to/config/dir -- preview --domains examples.com
56+ ```
57+
58+ VSCode equivalent configuration is:
59+
4360```
61+ "configurations": [
62+
63+ {
64+ "name": "preview example.com",
65+ "type": "go",
66+ "request": "launch",
67+ "mode": "debug",
68+ "program": "${workspaceFolder}/",
69+ "cwd": "/path/to/config/dir",
70+ "args": [
71+ "preview",
72+ "--domains",
73+ "example.com"
74+ ]
75+ }
76+
77+ ]
78+ ```
79+
You can’t perform that action at this time.
0 commit comments