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")}