I have a folder, D:\Data\Git\go\src\demo containing one file, main.go. I have installed go1.12.6 windows/amd64. (I am running Windows 10) I am unable to debug the application - the debugger flashes on the screen then disappears ==> nothing happens ==> even though I have set a breakpoint, it does not break into the code for interactive step-through! I can run the app from the commandline ==> go run main.go (current directory is where main.go is located)
My launch.json looks like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"env": {},
"args": []
}
]
}
Here is my app:
package main
import "fmt"
func main() {
s := []int{2, 3, 5, 7, 11, 13}
s = s[1:4]
fmt.Println(s)
}
How do I get to debug in VS Code?