On the Go Language (i) Development environment configuration and testing.

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

1. Go Download Address

Http://code.google.com/p/go-windows

2. Configure Environment variables

Select My Computer, right-click Properties, select Advanced tab, click Environment variable settings below

Add the following 4 environment variables in the system environment variable respectively

Goroot The Go installation path such as C:/go

Goos MinGW

Goarch 386

Path the bin path for go such as c:/go/bin (path variable is usually present, open directly, the semicolon in the first + half-width state, and then enter the bin path in front of the semicolon )

Once setup is complete

Enter cmd in the run

Then type:8g

See if you can find the path, if the command is not found problems, then congratulate you, the configuration is successful, if the prompt cannot find the command, then the configuration is not successful, you can set to configure the test, how there are problems, specifically can contact me, we discuss together (MSN alifel@live.cn )

3. Program Test

Open Notepad and enter the following code:

[CPP]View Plaincopyprint?
    1. Package Main
    2. Import "FMT"   
    3. Func Main () {
    4. FMT. Printf ("I am very happy!"  );
    5. }
Package <textarea style="DISPLAY: none" class="cpp" rows="15" cols="50" name="code">Mainimport "FMT" Func Main () {FMT. Printf ("I am very happy!");}</textarea>

Then save as mycoder.go ( suffix can be any )

Compiling the program

Switch to the path under the source code in CMD

(DOS command review: "cd/" to the root directory; "Drive letter:" Switch letter; "CD folder name" into the folder )

Input:8g mycoder.go(carriage return)

At this point, if the program normally produces a mycoder.8 file

Connection Program

Input:8l-o *.exe mycoder.8 return

(* represents the file name of the executable file generated after the connection, in which case the 8l-o MyCoder.exe mycoder.8)

If the program is OK, a MyCoder.exe file is generated

Run the program

Input:mycoder

Everyone will see the screen printed out I am very happy!

Now, the Go language development environment has been successfully configured

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.