We will install the Go language via this shell script by Jorge Canha.
This script is brilliant. It provides you with a single user installation of Go. It does everything for you including the download of the latest Go version.
As regular user 'yamn' (create user yamn if she does not exist) download the Golang Tools Install Script:
yamn@debian:~$ wget https://github.com/canha/golang-tools-install-script/archive/master.zip
Unzip master.zip
yamn@debian:~$ unzip master.zip
If you encounter an error trying to unzip the archive then you probably don't have the Unzip program installed. As root or as sudo user do "apt install unzip" and try again.)
Now move into the newly extracted folder
yamn@debian:~$ cd golang-tools-install-script-master
and do:
yamn@debian:~/golang-tools-install-script-master$ bash goinstall.sh
That should set you up with an installation of Go and automatically insert the necessary PATH information into your .bashrc file.
Logout of user yamn. Then log in again.
The Go language is now installed.
To check that your Go installation is working run the following command:
yamn@debian:~$ go version
go version go1.18.1 linux/amd64
Done!