Go (golang programming language)
Install Golang with Homebrew:
$ brew update It takes a while to pull all the latest ... be patient ... $ brew install golang
$ vi .bashrc
Then add those lines to export the required variables
This is actually your .bashrc file
export GOPATH=$HOME/go-workspace # don't forget to change your path correctly!
Create your workspace:
Create the workspace directories tree:
$ mkdir -p $GOPATH $GOPATH/src $GOPATH/pkg $GOPATH/bin
$GOPATH/src : Where your Go projects / programs are located
$GOPATH/pkg : contains every package objects
$GOPATH/bin : The compiled binaries home
Format your Go code
Go has a tool that automatically formats Go source code.
$ gofmt -w yourcode.go
$ go fmt path/to/your/package
When installed, try to run
go version to see the installed version of Go.
davidr$ go version
go version go1.13.4 darwin/amd64