go--Build the Go development environment under Win7

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

1. Download the Go Platform installation package first

Installer Download Address: https://golang.org/dl/(in-Wall download address http://www.golangtc.com/download), if your system is a windows32-bit system, Please select Go1.3.3.windows-386.msi, others, please follow your desired version to download;

2. Installing and configuring environment variables

Because there are two types of installation packages under Windows: MSI and zip, zip is free to install, decompression is available after configuring some environment variables, MSI is the installation package version, the corresponding environment variables are set when installing. My computer is Win7 64 bit, because convenient, downloaded the following version. After the installation of the package, the installation process is very simple, all the way "Next" is good. Although the MSI will automatically configure some environment variables, I have configured the environment variable after installation, so after going to install go, we'd better check whether all the environment variables are normal. The main environment variables are as follows:

    • installation directory for Goroot:go
    • Gopath: The directory used to store the Go language package, which cannot be in the Go installation directory
    • Gobin:go binary Files directory, written%goroot%\bin is good
    • GOOS: Operating System
    • Goarch: Specifies the system environment, i386 represents the X86,AMD64 representation x64
    • Path: You need to add the%gobin% to the end of the path variable to make it easy to run go at the command line
    • Like my own installation, the download is completed after the extract to any directory ( all directories can not be used in Chinese ): D:\Go;
    • Then the GO environment variable is configured:

      Goarch:386 (Go install version)

      Gobin:d:\go\bin (exe execution file path)

      Goos:windows (go running system)

      Goroot:d:\go (Go decompression path)

      Gopath:e:\go\data (Go Toolkit path, arbitrarily specified , will be used later)

      Then append to the PATH environment variable:;%gobin%

      After completion in the CMD window, enter: Go version

    • This way, the go development environment is built.

3. After setting up the development environment, then use the Liteide editor to run go. (http://www.golangtc.com/download/liteide), My computer is:

After the download and installation is complete, open the application, "View" and "Edit current Environment" to confirm that the Goroot variable matches the Go installation path:

"View" and "Manage Gopath" (the default is to install go, the random path specified)

4. New Small Project:

Select the Gopath that you added in the previous step, template for Go1 Command Project, write your own name, and click Ok-->yes:

5. Operation Result:

In this way, a small demo will come out.

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.