Installing the Go Programming Language on Ubuntu 12.04 LTS

Go, also known as Golang, is an open source programming language that was first designed and developed by Google. This tutorial will help you install Go on your Ubuntu 12.04 LTS.

First, ssh into your Pod as root. In this example, the Pod’s hostname is gopod. Once logged in, Go can easily be installed with the apt-get package manager:

root@gopod:~# sudo apt-get install golang

That’s it. You can now test that the install worked correctly by writing your first Go program, and running it.

Create a file called hello.go, containing the below:

package main

import "fmt"

func main() {
    fmt.Printf("hello, world\n")
}

You can run this as bellow, and should see “hello, world” as the output.

root@gopod:~# go run hello.go

Matthew McCaffrey

Leave a Reply