Go language basic Environment building and HelloWorld

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

The Go Language (Golang) is a new programming language launched by Google. For its detailed introduction please Baidu, Direct introduction of the basic development environment configuration.

1. Install the Go installation package.

The official download address should be https://code.google.com/p/go/downloads/list.

But if you are in the wall, you should be unable to access the address, here is the version is Go1.3.windows-386.msi, can be directly Baidu file name download installation.


2, configure environment variables.

This is similar to the Java environment variable configuration, with slightly more configuration items. Specific as follows:

new variable name: GOBIN variable Value: D:\Program Files (x86) \go \ Bin

New variable name: Goarch Variable Value: 386

New variable name: GOOS Variable Value: Windows

New variable name: Goroot variable Value: C:\go

Edit path at the end of the variable value of path plus%gobin%
D:\Program files (x86) \go is the native go install location, the MSI file installed, the Go language environment variables will be set automatically. Test command discovery is not recognized, view environment variables only path and Goroot are set, so you can reset it yourself.
3, test the installation is successful.
To bring up the command prompt, enter go version and the following message appears at the command prompt, indicating that the installation was successful.

Microsoft Windows [version 6.1.7601] Copyright (c) Microsoft Corporation. All rights reserved. C:\users\princeterence>go Versiongo version go1.3 windows/386

5. Hello world! using Notepad, create a new text and enter the code as follows:
Package Mainimport "FMT" Func Main () {FMT. Printf ("Hello world!\n God Bless you!");}

then save as Test20150525.go, where the file has an E disk, and then execute the following compile command to complete the compilation execution.
E:\>go Build Test20150525.goe:\>test20150525.exehello world! God Bless you!

Gensis 14:12 and they took Lot,abram ' s brother ' s son,who dwelt in sodom,and his goods, and departed.


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.