Go is the go-to language for distributed and highly scalable servers. If you’re looking to start working with this language on Linux, Jack Wallen has you covered.
Go is one programming language that’s on the rise. In fact, according to Popularity of Programming Languages, Go is at No. 14 and steadily climbing up the ranks. Go is used specifically for distributed systems and highly-scalable network servers and has replaced C++ and Java in Google’s software stack.
Chances are, you’ll be using Go sometime soon. For those who develop on Linux, you can’t just install it from the standard repositories. So how do you install this popular programming language on the open source operating system? Fear not, I’m going to show you.
SEE: Telephone interview cheat sheet: Software developer (TechRepublic Premium)
How to install Go on Linux
This can be done on most all Linux distributions, so log in to your favorite Linux development machine and open a terminal window.
From that terminal window download the Go binary files with the command:
curl -O https://storage.googleapis.com/golang/go1.13.5.linux-amd64.tar.gz
Once that file download completes, unpack it with the command:
tar -xvf go*.tar.gz
Next, move the newly-created go folder with the command:
sudo mv go /usr/local
We now have to add the go folder to our user PATH. Issue the command:
Scroll to the bottom of that file and add the lines:
export GOPATH=$HOME/work and export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
Save and close that file. Refresh your profile with the command:
You can now check to make sure the go folder is in your usr PATH with the command go version. You should see the version number of the installed Go language printed out.
And that’s all there is to installing the Go language on Linux. You are now ready to start developing with this popular language. Happy coding!