Go install and compile using

Source: Internet
Author: User
Tags mercurial
This is a creation in Article, where the information may have evolved or changed.

1. Install the required compilation environment


sudo apt-get install bison libc6-dev Ed python-setuptools Python-dev build-essential


sudo easy_install mercurial


2. Download the latest Go compilation environment with mercurial

HG Clone-r Release Https://go.googlecode.com/hg/go

Stuck


HG Clone-u Release Https://code.google.com/p/go

Suck


Mainly because of the wall.

You can only manually download source files to Https://code.google.com/p/go (go1.1.2.src.tar.gz)

3. (Go will only be installed by default in the uncompressed directory, which needs to be set in step 5)

CD GO/SRC

./all.bash

4.

When the test case is displayed correctly, it indicates that the go installation was successful

5.

Set Environment variables:

Vim/home/xxxx/.bashrc

Export Goroot=/home/xxxx/cplus/go
Export goarch=386
Export Goos=linux
Export path= $PATH: $GOROOT/bin

(Red must be set)

6.

1 Interpretation execution

Go Run hello.go

2 Compile execution

Go Build Hello.go

./hello




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.