Update Golang Version
How to update Golang version in linux
As software engineers we need to change our development environments base on the software requirements.
In my case to improve my Golang development environment I found out version 1.18.x deliver a new feature call workspaces.
You can follow the next steps to update your golang version or install a different version of golang.
- find where go binary is installed
which go
and it should return you an output similar to/usr/local/go/bin/go
keep in mind that depending on your Linux Distribution the location of the golang binary may change.
now we know the location is/usr/local/go
- remove the go installation
rm -f /usr/local/go
- download the desired version of golang from go.dev. In my case I want 1.18.1
wget https://go.dev/dl/go1.18.1.linux-amd64.tar.gz
- extract the package
tar -xvf go1.18.1.linux-amd64.tar.gz
- move the new package where the old was
mv go /usr/local
- check if you are using your new golang binary
go version
it will return something likego version go1.18.1 linux/amd64