System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
$ sudo rm -rf /usr/local/go
Go to the downloads page and download the binary release suitable for your system.
To extract the archive file:
$ sudo tar -C /usr/local -xzf /home/nikhita/Downloads/go1.8.1.linux-amd64.tar.gz
$ echo $PATH | grep "/usr/local/go/bin"
Also this is required for debug golang
make sure version is 1.15 or higher
install dlp and dlp-dav in the go tool extension - Ctrl+Shift+P > Go Install dependecies
This is the launch.json settings
{
// 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": "${workspaceRoot}"
}
]
}