Debug Golang with vscode

Make .vscode directory in your project.

Put launch.json file inside the folder.

and put below json inside the file.

then press Cntl + F5

json
{    // 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 Package",            "type": "go",            "request": "launch",
"mode": "auto",            "program": "main.go",            "envFile": "${workspaceFolder}/.env"
}    ]}