First, in the construction of the time to refer to the following articles
Http://www.cnblogs.com/zsy/archive/2016/02/28/5223957.html
http://blog.csdn.net/hil2000/article/details/51714607
Http://www.cnblogs.com/mubing/p/5820038.html
http://www.golangtc.com/t/57d3961db09ecc1635000170
Second, prepare (download all required software)
1, Vscode
Http://code.visualstudio.com/docs/?dv=win
2, Go API Pack (because of being strong, so used in domestic)
Http://www.golangtc.com/download
3. Download go third-party expansion pack (including smart tips, indexes, packages, etc.)
1) Https://github.com/golang/tools
Go third-party expansion pack Tools package
2) Https://github.com/derekparker/delve
This package is used for debugging purposes
3) Https://github.com/peterh/liner
Third, installation
1. Install Go API pack
The installation process is the next step, OK.
Here is the main point, after the installation is completed, you need to open the System environment variable Settings window, go to the necessary parameters set
Goroot here GOAPI package installation root directory
GOBIN here Go's Bin directory
Gopath Here working directory (this directory can be arbitrarily specified)
Path Add%gopath%\bin;d:\go\bin (This can also be%goroot%\bin)
It is best to open cmd input go env to see if the relevant parameters are set.
2, Installation Vscode
The installation process is the next step
Here you can select all.
3. Set up working directory
1) Create a new src and bin two folders in Goworksapce
Src\golang.org\x\tools create the appropriate folder based on this directory and unzip the previously downloaded go Tools package into this directory
Src\golang.org\derekparker\delve create the appropriate folder based on this directory and extract the previously downloaded delve package to this directory
Src\golang.org\peterh\liner creates a relative folder based on this directory and extracts the previously downloaded liner package in this directory
2) Install and register these third-party class libraries
Open the CMD Command window and copy the following to the window for installation
1Go get github.com/nsf/Gocode2Go get github.com/rogpeppe/Godef3Go get github.com/golang/lint/Golint4Go get github.com/lukehoban/go-find-References5Go get github.com/lukehoban/go-Outline6Go get sourcegraph.com/sqs/Goreturns7Go get golang.org/x/tools/cmd/Gorename8Go get github.com/tpng/gopkgs9Go get github.com/newhook/go-symbolsTenGo get github.com/peterh/Liner OneGo get github.com/derekparker/delve/cmd/DLV AGo get Golang.org/x/tools/cmd/guru
4. Open Vscode---Open folder, set D:\GoWorkSpace working directory, and create a new file named Test.go
Package Main Import "FMT"func Main () { fmt. Println ("Hello world!" )}
Copy the above content. Press F5 to execute.
Build go development environment under WIN7 environment, based on Vscode editor