search

Loading

Thursday, June 6, 2013

How to install go language tools in ubuntu

In the latest version of Ubuntu, the go language tools may be already available in the repos. In that case try,

   sudo apt-get install golang

If it is not working, add go tools PPA and install it.


   sudo add-apt-repository ppa:gophers/go

   sudo apt-get update 

   sudo apt-get install golang-stable

Then create a go lang program, say helloword.go and run it to test it.

cat helloworld.go
package main

import "fmt"

func main() {
    fmt.Println("Hello World")
}

Then run it,

 go run helloworld.go 

If everything is okay, it will give the below output and you are good to go.

Hello World




Reference:
http://code.google.com/p/go-wiki/wiki/Ubuntu
http://golang.org/doc/install

No comments :

Post a Comment