Build developemnt environment for go

Source: Internet
Author: User

1. Download Source: http://golang.org/doc/Installed, here I haved file named 'go1.1.linux-386.tar.gz ', decompress it.

2. To build the go distribution, run

$ CD go/src
$./All. Bash

(To build under Windows use all. bat .)

If all goes well, it will finish by printing output like:

All tests passed

---
Installed go for Linux/amd64 in/home/you/go.
Installed commands in/home/you/go/bin.
*** You need to add/home/you/go/bin to your $ path .***

3. Here, So you cocould Add the following commands:

Export goroot = $ home/install_soft/go
Export Gobin = $ goroot/bin
Export Path = $ path: $ Gobin

4. craete a file name hello. Go:

Package main

Import "FMT"

Func main (){
FMT. printf ("Hello, world \ n ")
}

Then run it with the go tool:

$ Go run Hello. Go
Hello, world

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.