This is a creation in Article, where the information may have evolved or changed. Original address: http://bbjava.iteye.com/blog/2004373
This article is intended for Linux.
First get the Go language kit download address: https://go.googlecode.com/files/go1.2.linux-386.tar.gz
Put it in any directory of Linux.
Using a command reference
TAR-XF go1.2.linux-386.tar.gz
Execute command re-execute: LS
You will see a directory named "Go" in the current directory.
[Root@blade go]# cd go[root@blade go]# lsapi blog favicon.ico LICENSE pkg srcauthors CONTRIBUTORS include misc README testbin Doc lib patents robots.txt VERSION
Enter the SRC directory:
[Root@blade go]# cd src[root@blade src]# lsall.bash clean.bash cmd libmach make.dist Race.bash run.batall.bat clean.bat lib9 make.bash make.rc race.bat run.rcall.rc Clean.rc libbio make.bat pkg run.bash sudo.bash
Then, install the kit
Type the command:
Wait for it to finish.
Finally, the installation is complete, there are several lines, one of the more important sentence:
You must add the/home/blade/go/go/bin to PATH.
In general, path is configured in the directory:/etc profile.
For example, my configuration is this:
Export path= $PATH:/home/blade/go/go/bin
Configured, and then enter the Source/etc/profile notification system profile updated.
It should have succeeded now that he had installed Ann.
Hello World in Go programming language
Type the code using VI:
Reference
Package Mainimport "FMT" Func Main () {FMT. Println ("Hello,world")}
Perform
The installation and initial use of this go language is complete. It's simple.