Install Golang the Right Way

Aishik Saha
Aishik Saha
Published in
1 min readMay 7, 2017
Captain Gopher

Go is a programming language created at Google in 2007. It is used in production at Google. A lot of companies now develop with Golang. Some awesome projects written in Golang are Docker, Moby, Caddy and Kubernetes.

Let’s Begin

1. The following code downloads the Golang files. Decompresses it. Then moves it to the appropriate directory.

$  wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz$  tar xvf go1.8.1.linux-amd64.tar.gz$  sudo chown -R root:root ./go$  sudo mv go /usr/local

2. Setting Go Paths

$  sudo vi ~/.profile

Now at the end of the file add the following lines.

export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

Now we refresh the saved file with the next one liner.

source ~/.profile

Now you’ve got Golang setup on your machine. You can find official Docker images of Golang at https://hub.docker.com/_/golang/. That’s all folks!

Follow me on Twitter @thecodeboy to read about containers and the cloud.

--

--

Aishik Saha
Aishik Saha

Engineer. Interested in machine learning, cloud, containers and open source. Built Slyme (https://5ly.me).