The configuration may change with the official, and this article is for informational purposes only.
1. Download and install Go package
Download the package for the corresponding operating system to Https://code.google.com/p/go/downloads/list (the author chose Go1.0.3.windows-amd64.zip when writing this article)
PS: There are two ways to install, using an MSI installation that automatically helps you configure environment variables. After using Zip decompression, you have to manually set the environment variables.
2. Setting Environment variables
To configure Go's environment variables in My computer:
2.1 New environment variable Goroot, value is the root directory of the go you unzipped (author's C:\go)
2.2 Add the Go bin to the PATH environment variable, and the author is%goroot%\bin;
2.3 Open the CMD command line and enter go. If the configuration is correct, there is a helpful hint.
3. Set Eclipse Install Go plugin
3.1 First download eclipse (the version used by the author is Eclipse Jee 4.2)
3.2 Installing the Go Eclipse plugin
In Eclipse's help-"Install new software-" add-"Add the Go Plugin installation address: http://goclipse.googlecode.com/svn/trunk/ goclipse-update-site/-"Then it is easy to understand the installation, not in detail."
3.3 Supplements
In this brother's article (provided later), wrote that there was also a need to configure Gocode (a plug-in that is automatically complementary to the input code) that the author did not use because the simple code completion feature was brought in when writing the Hello World test program; The article also wrote about the need to configure MinGW, The author also did not download the configuration because Hello World was able to function properly. Possible subsequent development needs, which are supplemented later. Lest the learning curve should be raised at a draught.
Interested students, can directly refer to the official documents to understand and configure http://golang.org. The author uses the decompression installation method of the Windows version of Go, which is only described above. If there are deficiencies please instruct.
2012-03-31: The new version of the Goclipse improved a lot, this article some of the content is outdated.
1. Download the install package under go Windows:
Https://code.google.com/p/go/downloads/list
You can also download the source code and compile it with MinGW . First configure a good mingw environment, and then run All.bat can be.
mingw:http://www.mingw.org/
2. Download Gocode, for Go's full tip:
Gocode's GitHub Address:
Https://github.com/nsf/gocode
To install GIT, you typically use msysgit under Windows.
https://code.google.com/p/msysgit/
Install again under cmd:
Go get-u github.com/nsf/gocode
You can also download the code, compile it directly with the go build, and generate Gocode.exe.
3. Install Plug-ins in eclipse:
Http://code.google.com/p/goclipse/wiki/InstallationInstructions
4. Configure plugins: (1). Configure Go Compiler
(2). Configure Gocode (optional), here I use the Eclipse plug-in with its own gocode.
(3). Configure GDB, make a trial (optional)
If you have MinGW installed, you can find gdb under the installation directory.
5. Test success
Create a new Go project and build a hello.go. The following figure:
GDB is debugged as follows (to be debugged with input commands in the console):
6. Other
March 31, 2012:
At present, the Eclipse plug-in can only be run with the code in the CMD package.
Seems to be popular now is sublime Text2 + Gocode. Sublime text is also really easy to use.