This is a creation in Article, where the information may have evolved or changed.
Working environment: Ubuntu9.10
A. Install the C language tool
The tools chain of Go is written in C and the following development tools are required to build:
Gcc
C Language standard library,
The parser generator Bison,
Make
awk, and
Ed (editor).
For OS X Systems, the above tools are part of Xcode.
For the Ubuntu/debian system, run the Install command:
sudo apt-get install bison ed gawk gcc Libc6-dev make
B, installation Mercurial
You need to install the mercurial version management system before doing the following operations (you can output HG noun detection for installation). Enter the following command to install:
sudo easy_install mercurial
For Ubuntu/debian Systems, the Easy_install command can be used
Apt-get Install Python-setuptools Python-dev build-essential
Installation. If the above command fails to install, you can also try to download the official website.
C, get the code
The following command creates a go directory. Switch to the appropriate directory and make sure the Go directory does not exist at the current location, run the command:
$ HG Clone-r Release Https://go.googlecode.com/hg/go
D, install Go
To compile the GO environment:
$ CD GO/SRC
$./all.bash
When the compilation is complete, the following information is printed at the end.
---CD. /test
---
Installed Go for linux/i386 In/home/fuhao/go.
Installed commands In/home/you/go/bin.
You need to Add/home/you/go/bin to your $PATH. ***
The compiler is 8g.
where n differs for different versions, indicating the number of failed tests.
E, update go
$ cd GO/SRC
$ HG Pull
$ HG Update release
$./all.bash
F. Setting Environment variables
Edit/HOME/FUHAO/.BASHRC File
# Set Go Environment
Export goroot= $HOME/go
Export goarch=386
Export Goos=linux
Export gobin= $GOROOT/bin
Export path= $PATH: $GOBIN
Verify that the setting is successful: 8g-v
Window Development Environment:
There are two versions of the http://code.google.com/p/gomingw/downloads/list download. EXE and zip Green edition
Download install or unzip. Setting environment variables
Goarch=386
Gobin= D:/program/go/bin (You go to install directory)
Goos=windows
Goroot=d:/program/go
Path added:;%gobin%
Then enter the 8G-V test under DOS to be safe and successful.