This is a creation in Article, where the information may have evolved or changed.
Weekend is OK, plan to learn a weekend language, finally selected the current more popular go language, usually used to use eclipse as the main development tool, here is how to build the Golang development environment in Eclipse, mainly installs the Goclipse plug-in.
1. Download and install go and configure environment variables
Because the country can not access Google, to download the official website of the installation package need to go agent, if not, you can download http://www.golangtc.com/download in Golang China, according to the number of system bits to select the zip file download, this is free installation version, direct decompression, Configuring Environment variables
Install directory for new variable name Goroot,value=go
In the path of the celestial sword%goroot%\bin
Create a new variable name Gopath, custom directory, you must configure this variable name
Now that go has been installed, the test is normal, open cmd, execute go command, see if there is a print
If not, see if the environment variable is configured correctly
2. Eclipse Installation Goclipse
If the wall can be turned over, then eclipse->help->install new Software->add to download the installation, to ensure that Eclipse has installed the CDT premise
Download link http://goclipse.googlecode.com/svn/trunk/goclipse-update-site/
If you do not have access to foreign sites, in the Eclipse Marketplace search installation, in eclipse4.5, I did not search, only through the first download installation, can be found in eclipse4.6+, click Install Download installation
After the installation is complete, restart Eclipse, where window->preferences can see
Click Go to configure the Go installation directory
When you click Tools, install the Go tool plugin
Among them, gofmt can be found directly in the bin directory of Go, godef refers to click download Download, download will automatically backfill, Gocode and Guru is unable to download backfill, need to build their own hand, the method is as follows
First you need to install the GIT shell locally, install the tutorial on the Internet to find, after the installation is complete, the above Gopath directory is configured as a git local repository
Go to cmd and execute go get-u-v github.com/nsf/gocode
Execute Go get-u-v golang.org/x/tools/cmd/guru
After each execution, the corresponding code is downloaded in the directory, and the EXE file is automatically generated in the Bin directory.
Fill in the corresponding Gocode.exe.guru.exe, Eclipse integration Goclipse This completes, then you can start the first program Hello Word
New A Go Project projects, new package under SRC, because the SRC directory can not directly put the go file, under the package to create a new Hello.go, execute code