Go programming was recently released by Google as a language system, focusing on ease of development, compilation rapid and simultaneous computing. It could well be the ideal language to develop a custom Web server and distributed computing in the near future. But we do not know with certainty, because it is still tested. Anyway, it does not hurt to have a little fun with ours.
I'm going to guide you to build a build environment, assembling the first Go program - "Hello World!". knowledge and skills in the moderate administration of Linux servers and programming is preferred. To keep things simple, this tutorial assumes you log in as root (so there is no need to use "sudo" to do things). Now let's go.
First you need a Linux server set up. You can install the distribution on your own computer or simply for a VPS. I use Debian 5.0 on a server Rackspace Cloud.
Log of the SSH server, add these lines (the environment variables Go translators need to work properly) to.bash_profile root's home directory:
GOROOT Export = $ HOME / go
Export GOARCH = 386
Export GOOS = linux
GOBIN Export = $ HOME / bin
PATH = $ PATH: $ Gobin
GOARCH = 386 is 32-bit architecture, if the server's CPU is 64-bit architecture, use:
Export GOARCH = amd64
In place. So they have everything in its place the following order:
source.bash_profile
Most likely you do not have the "hg" command installed. Run:
aptitude install mercurial
To install it. command "hg" to get the source code from Google:
hg clone-r $ GOROOT Publications
Simply download the source code release in the directory you just set at $ GOROOT / home / user / go. Now we will install the necessary compilers (GCC), C library and utilities related to the cause of GB collection is written in C:
aptitude install gcc bison libc6-dev make ed
Where is the Bison parser generator, ed is a text editor and compiler. If all goes well, you can compile Go now:
cd $ GOROOT / src
all
The base compiler test at the end of the compilation.
When it was over. We try to write and translate our first Go program Although you can use the editor of ED, we have just installed the program to write and record (prior to compilation, the program has only a single text file), I intend to use the "nano" Windows Notepad cousin of Linux to make a demo. Open the nano editor:
nano hi.go
And the guy in the following manner:
main package
import "FMT"
resulted in main () {
fmt.Printf ("Hello world!")
"Ctrl + x 'and press' y' to save the file to hi.go. Now that you have a source file hi.go GB, we can prepare:
8g hi.go
Whose output is a file named hi.8 to be bound by:
8 l hi.8
Which would output a second file called 8.out which is a binary executable - you did. Just run the file compiled by 8.out:
./8.out
It should print a new line: "Hello, world!
Note that if the server architecture is 64 bits, the compiler '6 g '(for 64-bit) instead of "8 g' (for 32 bits), the linker '6 l 'instead of '8' s and the output file and hi.6 6.out. You get the idea.
Tags: marketing internet paid offline business advertising auto insurance mobile advertising internet marketing devices cheap car insurance quote benefits internet marketing advertising jobs personal loans bad credit personal loans car insurance newloanrequest fast cash personal loans bad credit unsecured personal loans apply now easy personal loans secured personal loans va financial services personal loans government personal loans insurance car accident auto car cheap insuran insurance allstate insurance georgia cheap car insurance for woman cheap but good car insurance quotes consolidating federal student loans business process management small business marketing artigos relevante sobre marketing digital car cheap insurance jersey new term insurance super cheap car insurance for sr-22 cheap car insurance for young drivers unsecured business loans business make money online buy cheap car insurance agent student loans federal government residual income business opportunity writing a business plan internet marketing strategy web site traffic sale affiliate marketing programs buy cheap budget car insurance uk federal student loans repayment aspire resources inc federal student loans promoting
online business digital marketing agencies 2014 trends digital marketing.