This is a creation in Article, where the information may have evolved or changed.
Original address: http://studygolang.com/articles/4768
The native test is valid
Go-tour-zh is a Go language tutorial that can be viewed online or installed offline.
Online Address: http://go-tour-zh.appspot.com/welcome/
The following describes the method of offline installation, before installation, you need to first install the Go Development environment, configure the $gopath path.
First you need to download the tutorial offline package
Using HG Download, address: Https://bitbucket.org/mikespook/go-tour-zh
The command is: HG clone Https://bitbucket.org/mikespook/go-tour-zh
Note: The method for installing Hg under Mac is the Brew install HG
Install dependent packages
- Go get github.com/golang/net
- Go get Github.com/golang/tools
Create a workspace path
The installation path specified in the tutorial needs to be established to compile the run.
Place the downloaded Go-tour-zh in the $gopath/src/bitbucket.org/mkiespook directory
Put the downloaded net and tools packages in the $gopath/src/golang.org/x/directory.
├── bin├── pkg└── src ├── bitbucket.org│ └── mikespook│ └── go-tour-zh├── github.com│ └── golang└── golang.org └── x ├── net └── tools
Compiling the installation
Switch to $gopath/src/bitbucket.org/mikespook/go-tour-zh/gotour
Compile and install command: Go install
At this point, the Gotour binary program is placed in the bin directory, you can run the program now.
At this point you can enter the address in the browser address: http://127.0.0.1:3999, start to access the tutorial.