Home > Article > Backend Development > How to Set Up the Delve Debugger in Visual Studio Code for Go Development?
Setting Up the Delve Debugger in Visual Studio Code for Go Development
Facing difficulties getting the Go extension for VS Code to work, specifically for Delve debugging? Here's a comprehensive guide to resolve this issue.
Prerequisites:
VS Code Setup:
package main import "fmt" func main() { fmt.Println("Hello World!") i := 101 fmt.Println(i) }
Debugging in VS Code:
Step through the code:
Sample launch.json:
{ "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "go", "request": "launch", "mode": "debug", "remotePath": "", "port": 2345, "host": "127.0.0.1", "program": "${workspaceRoot}", "env": {}, "args": [], "showLog": true } ] }
Upon following these steps, Delve debugging should work seamlessly in your VS Code for Go development.
The above is the detailed content of How to Set Up the Delve Debugger in Visual Studio Code for Go Development?. For more information, please follow other related articles on the PHP Chinese website!