Skip to content

Instantly share code, notes, and snippets.

@cliveb
Last active August 29, 2015 14:00
Show Gist options
  • Save cliveb/11332515 to your computer and use it in GitHub Desktop.
Save cliveb/11332515 to your computer and use it in GitHub Desktop.
Setup Tour of Go on Mac
/**
* 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
@cliveb
Copy link
Author

cliveb commented Jul 8, 2015

$ 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment