Go Environment Building

Source: Internet
Author: User
Tags install go mercurial
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.