* This article is based on its own experience, inevitably there is unreasonable. * The following content for the author's original, reproduced please indicate the source.
First, installation
1. Install Go
Go Install package Address: Http://pan.baidu.com/s/1hq1mrDM (Download the corresponding version in the directory shown in the arrow)
* Note that the Go installation path cannot contain Chinese -------------------------------------------------------------------
After downloading installs, has the blog to say installs the go in this way does not need to set the environment variable (because has been set up automatically), but after attempts to discover this not to be possible (set not completely), still need to add environment variable. Contains:
-----------------------------------------------------------------------------------Goroot = E:\go (This assumes that the Go installation path is E:\go)GOBIN =%goroot%\binGoarch = 386 (if the system is 32 bits the value is 386, 64 bits is AMD64)GOOS = Windowsadd at the end of path;%goroot%\bin (note the preceding semicolon) For Gopath Understanding and setting please refer to: http://blog.csdn.net/huyoo/article/details/22715307
* environment variable setting path: Right-click Computer--Properties--Advanced system settings-environment variables
* above environment variable, if not present, please add it yourself------------------------------------------------------------------------------------- after Setup is complete, run go in cmd, and if the Go Command's help appears, go is installed correctly.
2. Installing Sublime
Sublime installation package address: Http://pan.baidu.com/s/1i32abBJ after downloading the installation, open the software and click on the menu bar: Preferences-->package Control ( or use the shortcut key ctrl+shilft+p)Input: Install, select the option shown (click or enter)Enter: Gosublime, Click in the list, or select Enter
In the status bar, you are prompted to install:
Prompt to restart sublime after installation is complete:
Second, use
after completing the above steps, you can edit the go code in sublime, which will provide automatic completion, syntax highlighting and other functions, the code will be automatically formatted after the input ctrl+s save the code.
input: Ctrl+b can bring up the console, where the code can be compiled and run (here the Test.go file is located on the desktop):
after compilation successful input: Test.exe output result
Using sublime text to build the Go language development environment under Windows