Wednesday, 5 June 2013

How to run a golang program

Go is a language developed at google. The golang programs are generally having the extension '.go'.

So this is how we run a golang program.


go run helloworld.go

This is the program

cat helloworld.go
package main

import "fmt"

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


When we execute it, we get the below output.

go run helloworld.go
Hello World


No comments:

Post a Comment