There are different programming languages, each with a focus on different segments of use for programmers, one of these languages is the Go language, which is a code project that presents us with a set of functions to make programming tasks something not just simple but much more enriching..
Go integrates different concurrency mechanisms so that program writing tasks are better exploited in multicore computers and computers on the network , additionally it has a type system for the construction of modular programs.
characteristics
Some of its most outstanding features are:
- Concurrency and garbage collection support
- Static and compiled type language
- Multiprocessing and high-performance networks
- Extensive toolset and library
getFastAnswer will take every step to install, and uninstall, Go on Ubuntu 20.04, 20.10, and 21.04..
To stay up to date, remember to subscribe to our YouTube channel! SUBSCRIBE
1. How to install Go on Ubuntu
Step 1
We open the terminal and execute the following command to download the latest version of Go:
sudo wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
Step 2
Once downloaded, we extract the content to the / usr / local path:
sudo tar -C / usr / local -xzf go1.15.5.linux-amd64.tar.gz
Step 3
Now, we add the go path to the .bashrc / etc / profile file in order for it to be installed throughout the system, we execute:
export PATH = $ PATH: / usr / local / go / bin
Step 4
We apply the changes with the following command:
source ~ / .bashrc
Step 5
We check the version of Go installed with the following command:
go version
Step 6
Alternatively, we can install Go using the Snap package manager with the following command:
sudo snap install --classic --channel = 1.15 / stable go
Step 7
We create a Go file with the following command:
cat> hello-solvetic.go
we enter the following:
package main import "fmt" func main () { fmt.Println ("Hello getFastAnswer!") }
Step 8
We press Enter to save the changes, now we execute the following to see the result of the above:
go run hello-solvetic.go
2. How to uninstall Go in Ubuntu
Step 1
As soon as you no longer want to use Go in Ubuntu, to uninstall it we are going to first execute the following:
sudo rm -rf / usr / local / go
Step 2
This will delete the extracted file in that path, now we access the binary file:
sudo nano ~ / .bashrc
Step 3
There we must find, if it exists, the $ PATH line and delete its content, if we do so we save the changes with the Ctrl + O keys and exit the editor with the Ctrl + X keys.
We apply the changes:
source ~ / .bashrc
Step 4
We check with "go version" that it is no longer available in Ubuntu:
So we have installed and uninstalled Go in Ubuntu 21.04, 20.10 or 20.04.