This is a creation in Article, where the information may have evolved or changed.
See a piece of news, inexplicable want to try to be some people praise the go language ...
1. Development environment Construction
"Of course you can install the compiled binary package directly, and Ubuntu's fool-style installation is very strong, here is the compilation steps in Ubuntu"
(1) Installing the mercurial tool, in order to obtain the HG command;
(2) Setting environment variable Goroot
Export Goroot=~/go
Of course, you need to create a new go directory for storing the source directory ...
(3) Get the source code of Go
HG Clone-r release https://go.googlecode.com/hg/$GOROOT
The internet is not good, it took a few minutes to get the code down ...
(4) This can finally compile the source code ...
CD $GOROOT/SRC
./all.bash
Ubuntu in the virtual machine is compiled slowly and slowly ..., wait for it ...
You can see the output after the compilation is complete:
All TESTS PASSED
---
Installed Go for linux/386 In/home/xiaohuan/go
Installed Commands In/home/xiaohuan/go/bin
You need to Add/home/xiaohuan/go/bin to your PATH.
(5) Need to continue setting environment variables
Export path= $GOROOT/bin: $PATH
2. Start writing Hello World
(1) Writing source code
Package Mainimport "FMT" Func Main () { fmt. Printf ("Hello go!\n")}
(2) compiling the source code
Go Build Helloworld.go
(3) execution, you can see the results
./helloworld
You can see the output: Hello go!
3. Go language
"Good for a short copy"
Go aims to provide the efficiency of astatically typed compiled language with the ease of programming of a dynamiclanguage . [9] Other goals include:
Safety:type-safe and Memory-safe.
Good support for concurrency and communication.
Efficient, Latency-free garbage collection.
High-speed compilation.
A lot of features, later to play ...