Go Language Environment Building

Source: Internet
Author: User
Tags install go golang ide

1. Download the Go Platform installation package first

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

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/934768/201607/934768-20160704175134561-1971641556. JPG "style=" margin:0px;padding:0px;border:0px; "/>

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%gobin% to the end of the path variable, so you can run go at the command line

  • 650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/934768/201607/934768-20160704180311655-136677618. JPG "style=" margin:0px;padding:0px;border:0px; "/>

  • 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

  • 650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/934768/201607/934768-20160704175920311-651592995. JPG "style=" margin:0px;padding:0px;border:0px; "/>, the Go development environment is built.

Editor:

The editor I'm using is idea:

Download site: http://www.jetbrains.com/idea/

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/96/B5/wKiom1kk3qWwV0O2AAKNM83laL4963.png-wh_500x0-wm_ 3-wmp_4-s_2352689764.png "style=" Float:none; "title=" 1.png "alt=" Wkiom1kk3qwwv0o2aaknm83lal4963.png-wh_50 "/>

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/96/B5/wKiom1kk3qfi64jRAAE_ygEr9yc006.png-wh_500x0-wm_ 3-wmp_4-s_890273307.png "style=" Float:none; "title=" 2.png "alt=" Wkiom1kk3qfi64jraae_yger9yc006.png-wh_50 "/>

Registration code is required after installation:

Online Generate Ieda Registration code website:

http://idea.lanyus.com/

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/96/B5/wKiom1kk3xvCta5BAAHpyUTj92g682.png-wh_500x0-wm_ 3-wmp_4-s_793403202.png "title=" 3.png "alt=" Wkiom1kk3xvcta5baahpyutj92g682.png-wh_50 "/>

After opening the idea needs to install the Golang plugin:

The IDE that supports Golang development is now a lot of, if you want to discuss which IDE is the best Golang IDE, this will definitely let a bunch of program ape tear force on hundred floor, here is not discussed. Choosing what kind of IDE is primarily a matter of personal preference. I'm used to the UI style of Android studio and IntelliJ idea, so I'm just going to talk about idea's Golang plugin configuration, and the other Ides don't, because I'm lazy.

Idea's Golang plugin is open source and the project is hosted on GitHub. If you are very good at technology, you can participate in the development of this plug-in, leaving a name, than to a certain scenic spot of the stone carved a certain to this one of the tour cock more.

Installing the Golang plugin on idea requires adding the Golang plugin's warehouse manually, and the Golang plugin currently has two warehouses:
1. alpha:https://plugins.jetbrains.com/plugins/alpha/5047
2. nightly:https://plugins.jetbrains.com/plugins/nightly/5047

The Golang plug-in for the two warehouses is updated every week for the Alpha repository, while the Golang plug-in version of the nightly warehouse is updated daily. Add the appropriate warehouse to your idea based on your own update frequency and add the following method:

  • Setting menu, select Plugin, click Browse repositories:
    650) this.width=650; "src=" http://img.blog.csdn.net/20151215195525282 "alt=" Settings "title=" "style=" Border:none; " />

  • In the Browse repositories window, select Manage repositories:
    650) this.width=650; "src=" http://img.blog.csdn.net/20151215200000685 "alt=" Browse repositories "title=" "style=" Border:none; "/>

  • The Custom Plugin repositories window appears, click the "+" button, enter the Golang plugin warehouse address after the point OK:
    650) this.width=650; "src=" http://img.blog.csdn.net/20151215200050323 "alt=" Add Custom Repository "title=" "style=" Border:none; "/>

  • Go back to the Browse Repositories window, top select the Golang plugin repository you just added, filter out the Golang plugin, select and click the Install plugin button to mount the plugin:
    650) this.width=650; "src=" http://img.blog.csdn.net/20151215200120846 "alt=" Install plugin "title=" "style=" border: none; "/>

  • Restart idea after installing the Golang plugin. Installation succeeded enough to enter File->other Settings->default Project Structure ..., select the SDKs option, add the Golang SDK and specify the SDK path:
    650) this.width=650; "src=" http://img.blog.csdn.net/20151215200151173 "alt=" Add Golang SDK "title=" "style=" border: none; "/>

  • Golang plug-in configuration, you can see the Go project and Golang SDK when creating a new project.


Go Language Environment Building

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.