Skip to content

Instantly share code, notes, and snippets.

@vijayakumar-psg587
Forked from nikhita/update-golang.md
Created September 9, 2021 07:13
Show Gist options
  • Save vijayakumar-psg587/9118b5542021d8f209b1126a179f2191 to your computer and use it in GitHub Desktop.
Save vijayakumar-psg587/9118b5542021d8f209b1126a179f2191 to your computer and use it in GitHub Desktop.
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

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

2. Install the new version

Go to the downloads page and download the binary release suitable for your system.

3. Extract the archive file

To extract the archive file:

$ sudo tar -C /usr/local -xzf /home/nikhita/Downloads/go1.8.1.linux-amd64.tar.gz

4. Make sure that your PATH contains /usr/local/go/bin

$ echo $PATH | grep "/usr/local/go/bin"
@vijayakumar-psg587
Copy link
Author

This works actually. so do this

In fedora go will be installed elsewhere, so the above operations is rather invalid

git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh

@vijayakumar-psg587
Copy link
Author

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}"
}
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment