A custom bash script that installs/updates your Go version on linux. Because shipping a language with a command that updates itself is way too mainstream.
If it's your first time installing go:
- Add /usr/local/go/bin to the PATH environment variable.
You can do this by adding the following line to your $HOME/.profile
or /etc/profile
(for a system-wide installation):
export PATH=$PATH:/usr/local/go/bin
Note: Changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.
If you're updating from a previous version:
- Check that Go has been updated by running the following command:
go version
sh ./update-go
For the official docs on how to install/update Go, please refer to https://go.dev/doc/install