Windows Platform Installation Configuration Golang language environment

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

Environment Introduction:

Os:windows 7 SP1

Arch:x86_64

Golang Ver:go 1.4.2 AMD64


1. Download the Golang language installation package:

Go was developed by Google in 2009, an open-source language. Github:golang/go. Can be directly on this to find out the source code (in fact, just for the source of the download, not made into the installation package), the source code compiled can be used. You can also find the Chinese forum for Go: http://www.golangtc.com/, where you can find the Windows installation package (. msc) for go.

Here I used go 1.4.2 version, download path: http://www.golangtc.com/download


2. Install Golang under Windows:

After downloading to the. MSC installation package, double-click Install to install, fool-type installation.


3, configure the Golang operating environment:

The Golang requires two basic environment variables:
(1) Goroot: Save Golang installation root directory;

(2) GOBIN: Save the bin path under the Golang root directory, usually set to%goroot%\bin under Windows;

There is also a gopath: typically used for the project root that you create yourself, and the custom package used at compile time will look for the source file from the src path of this variable.

Finally, don't forget to add the path to the Go Binary tool in the system environment variable path, which is%gobin%. General installation will have three basic binary tools: Go, Godoc, gofmt


4, detection Golang environment configuration is correct:

Under Windows Analog Terminal (CMD), type go version to view the Golang version information, and if it prints correctly, the configuration is OK and the Go tool runs correctly. You can also write a golang HelloWorld yourself:

Package MainFunc Main () {println ("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.