This is a creation in Article, where the information may have evolved or changed.
For the features of Go, refer to: http://blog.csdn.net/win_lin/article/details/18236737
Go environment
Download Linux 64-bit Go pack: https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz
Other references: Http://www.golangtc.com/download
After decompression, move to/urs/local/go:
tar xf go1.3.3.linux-amd64.tar.&&-p /usr/local/&&sudo mv go /usr/local/go
Set environment variables Path,goroot and Gopath:
mkdir -p /home/winlin/go &&sudo vi /etc/profile
Settings are as follows:
export PATH=$PATH:/usr/local/go/binexport GOROOT=/usr/local/goexport GOPATH=/home/winlin/go
Application configuration:
source /etc/profile
This can be compiled with go build and so on.
Godoc start
Install go to start the Godoc:
godoc -http=:6060
This way the access address can be: http://192.168.1.173:6060
Gotour Environment
Go-tour is a simple example of go and needs to download the project.
Since Google was dropped from the wall, it can be downloaded from a domestic image: Http://golangtc.com/download/package
Mkdir-p $GOPATH/src && cd $GOPATH/src &&wget HTTP://GOLANGTC. com/static/download/packages/code. Google. com. P. Go-tour. Tar. GZ&&wget HTTP://GOLANGTC. com/static/download/packages/code. Google. com. P. Go. NET. Tar. GZ&&wget HTTP://GOLANGTC. com/static/download/packages/code. Google. com. P. Go. Tools. Tar. GZ&&tar XF Code. Google. com. P. Go. NET. Tar. GZ&&tar XF Code. Google. com. P. Go. Tools. Tar. GZ&&tar XF Code. Google. com. P. Go-tour. Tar. GZ&&go Install code. Google. com/p/go-tour/gotour
Specific rules reference: http://blog.csdn.net/win_lin/article/details/18236737
Start Gotour:
$GOPATH-http="192.168.1.173:3999"
Access Address: http://192.168.1.173:3999/
Go Project
The project directly uses the path of the Gopath.
For example, the following items are $gopath: src/github.com/winlinvip/srs.go
Then you can directly import "github.com/winlinvip/srs.go"
inside the various packages.
Compile-time is like compiling for all projects:
go get github.com/winlinvip/srs.go/srs && $GOPATH/bin/srs
In fact, it is the right way to compile your project as if it were all referenced projects.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.