This is a creation in Article, where the information may have evolved or changed. Golang installation can be referenced by: Https://github.com/astaxie/build-web-application-with-golang sudo apt-get install Python-software-propertiessudo add-apt-repository ppa:gophers/gosudo apt-get updatesudo apt-get Install golang-stable Git-core Mercurial but the fourth step may fail, should be for the Golang is Google developed, in the domestic may be wall. Download and install the TAR package directly to unzip: Http://www.golangtc.com/download after decompression, configure the environment variable in the. BASHRC, and then source ~/.BASHRC.
Export go_install_dir=/local/tools/go/export goroot=/local/tools/goexport gopath=/local/program /go/export GOBIN=/local/program/go/binexport PATH= $PATH: $GO _install_dir/bin
Build 3 folders below the $gopath path bin, pkg, SRC
In src you can write the code of VIM Hello.go.
Package Mainimport ( "fmt") Func main () { fmt. Printf ("Hello, World. ") " )}
Run: $go Run Hello.go
Hello, world.