Last active
August 29, 2015 14:00
-
-
Save cliveb/11332515 to your computer and use it in GitHub Desktop.
Setup Tour of Go on Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Setup Go on a Macbook to complete online Tour of Go locally http://tour.golang.org | |
* | |
* Use Terminal program in Macbook to get a bash $ prompt | |
* Type the following: | |
*/ | |
$ export GOPATH=$HOME/godev | |
$ echo “Creating Go Dev Environment at $GOPATH” | |
$ mkdir -p $GOPATH | |
$ cd $GOPATH | |
$ echo “Getting the Go Tour package” | |
$ go get code.google.com/p/go-tour/gotour | |
$ echo “Creating the mytour directory for writing samples.” | |
$ mkdir -p $GOPATH/src/mytour | |
$ cd $GOPATH/src/mytour | |
/** | |
* Now create a slide1.go using Sublime or your favorite code editor. Save slide1.go in src/mytour | |
*/ | |
$ go run slide1.go | |
/** | |
* If you get error message go get code.google.com/p/go-tour/gotour go: missing Mercurial command. See http://golang.org/s * gogetcmd package code.google.com/p/go-tour/gotour: exec: "hg": executable file not found in $PATH | |
* | |
* Install Mercurial for your Mac | |
*/ | |
$ http://mercurial.selenic.com/downloads | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ export GOPATH=$HOME/godev
$ echo “Creating Go Dev Environment at $GOPATH”
$ mkdir -p $GOPATH
$ cd $GOPATH
$ echo “Getting the Gomobile tool for building and running mobile apps written in Go.”
$ go get golang.org/x/mobile/cmd/gomobile
$ echo “Creating the mygomobile directory for building.”
$ mkdir -p $GOPATH/src/mygomobile
$ cd $GOPATH/src/mygomobile