There are a few ways to install GoLang (pick one)
- On Mac
brew install go
- On Windows
- Download Go from here https://golang.org/dl/
- Install Go using the installer
- Web Based Compiler (no need to install anything)
- Open a browser
- Go here https://play.golang.org/
You need to setup your GOPATH, which is where all of your code will reside
- Mac:
export GOPATH=/Users/mack/go
Open up your favorite editor and create a new file, put the content list below in the file and save it in /Users/mack/go/src/example/main.go
package main
import "fmt"
func main() {
fmt.Println("Hello Detroit Black Tech")
}
cd /Users/mack/go/src/example
go run main.go
The ability to compile down to a single binary. This means there are no dependency on external libraries
go build
./example