here we Go

Little intro to Golang. I will try to add a section touching only one Golang topic per day, nothing more, nothing less. Most of this content will be based on the magnificent work done by Mark McGranaghan on https://gobyexample.com and official Effective Go documentation; even so I may add some notes here and there just for my mental health.


Install/Setup

I really don’t care what OS you use. If it is ok for you, I’m fine.
Under OS X we play hard with Homebrew.

$ brew install go

Go environment

$ mkdir -p $HOME/go/{bin,pkg,src}
$ export GOPATH=$HOME/go
$ export PATH=$PATH:$GOPATH/bin
$ go version
go version go1.4 darwin/amd64

helloworld.go

Package fmt

package main
import fmt
func main() {
fmt.Println("hello world")
}


$ go run helloworld.go
hello world