Go or Golang is an open source programming language created at Google. It is a compiled, statically typed language in the style of Algol and C, with garbage collection, limited structural typing, memory safety features and CSP-style concurrent programming features.

This guide will cover how to install and configure Go, as well as how to test it with a small and simple "Hello world!" program.


  1. Connect to your slot through SSH

  2. Download the latest archive

     wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz

At the time of writing, the latest version is 1.9.2. Later versions may have been released since then. Visit golang.org/dl/ to get the latest version. Ensure to download the Linux Intel 64 bit version.

  1. Extract the archive

     tar -xzf go1.9.2.linux-amd64.tar.gz
  2. Move the archive to your ~/.config/ directory

     mv go ~/.config/
  3. Make your Go workspace directory

     mkdir ~/.goworkspace
  4. Run the following commands to add these lines to ~/.bashrc. This will allow you to simply type go to use Go, and set Go's workspace and root for downloaded packages.

     echo 'export PATH=${PATH}:~/.config/go/bin/:~/.goworkspace/bin' >> ~/.bashrc
     echo 'export GOROOT=~/.config/go/' >> ~/.bashrc
     echo 'export GOPATH=$HOME/.goworkspace' >> ~/.bashrc
  5. Reload your ~/.bashrc to be able to use the newly added commands.

     source ~/.bashrc
  6. (Optional) Clean up the setup files.

     rm go1.9.2.linux-amd64.tar.gz

Go should now be installed in ~/.config/go/. The next part shall detail on how to use Go.


To run a file with Go, simply do the following:

go run <name of file to run>

Alternatively you can 'compile' the Go program with go build <name of file to build> which will create a binary of the file.

Simple Hello World Test

To verify that Go is working, the following is an easy and simple test that will print Hello world! to the terminal.

  1. Create the file for this test

     touch helloworld.go
  2. Copy the contents of the box below into the helloworld.go file


package main

import "fmt"

func main() {
    fmt.Println("Hello world!")
  1. Run the Go program with the following command

     go run helloworld.go

If everything is working, you should see Hello world! in the terminal! You can also build the program with go build helloworld.go, which means that you won't have to wait for Go to recompile the program everytime you want to run it.

Further Learning

Go documentation can be found on their official website at golang.org/doc/.