1. Golang Installation
Official website Download Address: https://golang.org/dl/
I'm using this version: Https://golang.org/doc/install?download=go1.10.3.windows-amd64.msi, if you can't download it, just hang a VPN.
Img20180809_162804.png
Installation
After downloading the installation package, double-click the installation package to install, you can specify the installed directory when installing
2. Golang IDE Installation
I use the Go IDE is Liteide, this is the Chinese development of the go Language IDE, the interface is simple and useful, most like, each time you save the code, will automatically help you to align the code
Download Address
- Official website: http://liteide.org/cn/
- Source: Https://github.com/visualfc/liteide
- Binary Download: https://sourceforge.net/projects/liteide/
Setting up an editing environment
The author is Win64 environment, the estimate is set to Win64, open View---Edit the current environment, set goroot for your go installation path
Img20180809_164012.png
Set/Add Gopath
View--Management Gopath, add your own go code path to Gopath, such as your own Go code path is E:\code\go
Img20180809_164802.png
You can also change the GOPATH environment variable to your go code path without using custom Gopath
Img20180809_165217.png
New Project
Select the Gopath path where you want to store your project, and then template for Go1 Command project
Img20180809_165610.png
Set compilation options and compile
Compile-and-compile configuration---Custom, add "-gcflags"-n-l on the Buildargs bar to remove compilation optimizations for easy debugging "
Img20180809_165933.png
CTRL + B compile the project, CTRL + F5 run the program
Img20180809_170507.png
- Code debugging
Press F5 to start code debugging, F10 Single step debugging, run results
Hello World!1!2!3!4!
So that your first go program is finished, is not very happy