Thursday, 6 June 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


No comments:

Post a Comment