https://go.dev/dl/go1.18.1.linux-amd64.tar.gz
Extract the downloaded archive into /usr/local, creating a Go tree in /usr/local/go with below command
sudo tar -C /usr/local -xzf go1.18.1.linux-amd64.tar.gz
Update Go to your environment profile
Open ~/.bashrc with vi, and add the following, and save it.
export GOROOT=/usr/local/go-1.18
export GOPATH=$HOME/projects/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:$HOME/projects/go/bin
Reload the bash profile with the following command
source ~/.bashrc
And check if go is installed successfully:
go version
how to use range in golang
posted on 2022-05-03 08:28:11 - Go lang Tutorials
find variable type in golang
posted on 2022-05-03 05:24:55 - Go lang Tutorials