This is a created article in which the information may have evolved or changed.
1,golang China download Go source http://www.golangtc.com/download please correspond to the system version number, linux-amd64.tar.gz for 64-bit system (recommended) , Linux-386.tar.gz for 32-bit systems
and unzip to the location you want to install (with/home/golang as cases urealyticum compressed to TAR-ZXVF plus file name)
2, configure environment variable vim ~/.BASHRC append the following content
Export Gobin=/usr/lib/golang/go/bin
Export Goroot=/usr/lib/golang/go
Export path= $PATH: $GOBIN
Export Gopath=/data/golang/gopher(project directory)
Save exit and Execute command source ~/.BASHRC overload
3. Whether the test environment is built successfully create go files anywhere
Vim Test.go
Append the following content:
Package Main
Import ("FMT")
Func Main () {
Fmt. Printf ("Hello world!")
}
Run go file go run test.go
Successful output Hello World
4, if you have any questions contact Bo Master QQ 495270968 | | Yanggege222221@163.com