Skip to content

Commit cd03f70

Browse files
gd doc
1 parent d6df623 commit cd03f70

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

go.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Hello World!
5353

5454
## VS Code
5555

56-
## Install plug in
56+
### Install plug in
5757

5858
Install "Go for Visual Studio Code" (ms-vscode.go)
5959

@@ -65,7 +65,41 @@ Set go.toolsGoPath to Tools/bin path
6565

6666
![settings](res/gousersettings.png)
6767

68-
ISSUE: Can't debug a [program using stdin](https://github.com/Microsoft/vscode-go/issues/219#issuecomment-192164367).
68+
69+
70+
### Debug
71+
72+
[VS Code Debug Wiki](https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code)
73+
74+
Start remote debugger in the prog dir (addresses STDIN issue below):
75+
76+
```bash
77+
$ cd someprogram
78+
$ gd
79+
API server listening at: [::]:2345
80+
...
81+
```
82+
83+
Create a 'Remote' config in VS Code, set breakpoints and debug.
84+
85+
```bash
86+
"configurations": [
87+
{
88+
"name": "Remote",
89+
"type": "go",
90+
"request": "launch",
91+
"mode": "remote",
92+
"program": "${fileDirname}",
93+
"remotePath": "${fileDirname}",
94+
"port": 2345,
95+
"host": "127.0.0.1",
96+
"env": {},
97+
"apiVersion": 1,
98+
"args": []
99+
}
100+
```
101+
102+
ISSUE: Can't debug a [program using stdin](https://github.com/Microsoft/vscode-go/issues/219#issuecomment-192164367).
69103
70104
## GoLand
71105
@@ -81,7 +115,7 @@ Preferences (or wrench bottom right). Set GOPATH for project and uncheck from e
81115
82116
![pathprefs](res/goland-gopath.png)
83117
84-
## Debugging with Delve
118+
## Debugging with Delve in Terminal
85119
86120
[Delve from the cmdline](https://lincolnloop.com/blog/debugging-go-code/)
87121

0 commit comments

Comments
 (0)