Configure your environment according to these steps:
- Download and install Go on your operating system from https://golang.org/doc/install, and configure your GOPATH environment variable.
- Open a terminal/console application.
- Navigate to your GOPATH/src and create a project directory such as $GOPATH/src/github.com/yourusername/customrepo.
All code will be run and modified from this directory.
- Optionally, install the latest tested version of the code using the go get github.com/agtorre/go-cookbook/ command.
- Run the go get gopkg.in/mgo.v2 command.
- To run the code, you'll need a working database connection to a MongoDB instance that this book will not cover.
- The basic setup is https://docs.mongodb.com/getting-started/shell/.