Go
- Go is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson.
- It is syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency.
- It is often referred to as
Golang
because of its former domain name, golang.org, but its proper name is Go.
Remove any previous version
By deleting the /usr/local/go folder (if it exists)
sudo rm -rf /usr/local/go
Download & Install current version
- Visit the Go official website:
https://golang.org/dl/
& Download the latest version - Open your terminal and cd into downloads
cd Downloads
- Extract the files
tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz
- Add Go PATH environment variable
export PATH=$PATH:/usr/local/go/bin
You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation)
- Verify that you’ve installed Go by typing in terminal
go version