To install go on your computer, you have first to download the installer corresponding to your operating system from the golang page.
Then you will have to follow the related instructions of installation that are described in that same page
• On Ubuntu: Extract the downloaded installer in /usr/local folder. Just type the following tar command
sudo tar -C /usr/local -xzf name-of-the-version.tar.gz
A new folder will be created : /usr /local/go. Add that path to your PATH environment variable by inserting the export path line to one of the two following files : $HOME/.profile or etc/profile file.
Let's say that you will edit the second one. You can use the nano command:
sudo nano /etc/profile
add the following line into the file.:
After saving the changes, and exiting nano, you can apply the changes and check the go version with the following commands:
But you will have to log out, and log in again to your user account, to make the changes permanent.Then check the installed version of go:
This being said, there is an other way to install the language without downloding the archive from the website. Just install the snap version:
sudo snap install go --classic
On Windows 10: just follow the instructions of the installer. After the installation, open a new command prompt window, and type in the following:/p>