Get Started

Install Golang with Homebrew:

1
2
$ brew update
$ brew install golang

Setup the workspace

Go has a different approach of managing code, you’ll need to create a single Workspace for all your Go projects. For more information consult setup the workspace

Hello world time!

Create a file in your $GOPATH/src, in my case hello.go Hello world program :

1
2
3
4
5
6
package main
import "fmt"

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

Run your first Go program by executing:

1
$ go run hello.go

Congratulations !!!!!!