Configure Eclipse + Go environment under windows

Source: Internet
Author: User
Tags sublime text gocode
This is a creation in Article, where the information may have evolved or changed.

http://blog.csdn.net/hengyunabc/article/details/7371446

This article address: http://blog.csdn.net/hengyunabc/article/details/7371446

2012-03-31: The new version of Goclipse has been greatly improved, and some of the content in this article is outdated.

1. Download the installation package for go under Windows:

Https://code.google.com/p/go/downloads/list


You can also download the source code and compile it with MinGW . Configure the MinGW Environment First, then run the All.bat.

mingw:http://www.mingw.org/

2. Download Gocode, for go full tip:

Gocode's GitHub Address:

Https://github.com/nsf/gocode

To install Git, under Windows, you typically use Msysgit.

https://code.google.com/p/msysgit/

Install again under cmd:

Go get-u github.com/nsf/gocode

You can also download the code and compile it directly with go build, which generates Gocode.exe.

3. Install the plugin in eclipse:

Http://code.google.com/p/goclipse/wiki/InstallationInstructions

4. Configure the plugin:

(1). Configure the Go Compiler

(2). Configure Gocode (optional), here I use the Eclipse plugin comes with the gocode.

(3). Configure GDB to make a trial (optional)

If MinGW is installed, you can find gdb under the installation directory.

5. Whether the test was successful

Create a new Go project and build a hello.go. Such as:

GDB debugs as follows (to debug with the input command in the console):

6. Other

March 31, 2012:

Currently this eclipse plugin can only be run with the code in the CMD package.

It seems that the popular is sublime Text2 + Gocode. Sublime text is also quite useful.

======================

Http://www.cnblogs.com/wenjingu/p/3229578.html

Configure the Go Language development environment (WIN7) under the Eclipse platform

"Go language Programming" wrote: "In terms of functionality and ease of use, eclipse+goeclipse, liteide These two environments in all the IDE is the best performance", so I intend to use the Eclipse+goeclipse development environment.

Configure the Go Language development environment steps under Eclipse Platform:

1. Installing JDK and Eclipse

Recommended JDK1.6 and above. Eclipse3.6 and above versions.

2. Install Goeclipse plug-in

In Eclipse, click the Menu "Help"-"Install New Software" to open the following dialog box, add the Go plugin installation address: http://goclipse.googlecode.com/svn/trunk/ goclipse-update-site/,

Follow the prompts to step-by-step, you may experience network problems while downloading, you can use goagent or other agents.

3. Install and configure the Go compiler

Download Address: Https://code.google.com/p/go/downloads/list

Please note the version when downloading, should choose the version of windows-386.

After installation, restart Eclipse and open the Go Language configuration Options box via the menu item "window"-"Preferences"-"go". Such as:

Choose the installation path of Go, as the author's installation path is F:\Work\Go

4. Configure the debugger (optional)

Need to install MinGW first, download address: http://sourceforge.net/projects/mingw/files/MinGW/

After installation, open the configuration options box for the debugger via the menu item "window"-"Preferences"-"Go"-"Debugger".

Configure the GDB path to: MinGW the Gdb.exe file in the installation directory.

5. Automatic completion of configuration code (optional)

You need to configure Gocode, you can use the Goeclipse plug-in version, or download it yourself: Https://github.com/nsf/gocode

The author uses the Goeclipse plug-in version, the configuration is as follows:

Open the Configuration Options box through the menu item "window"-"Preferences"-"Go"-"Gocode".

Configure the path of the Gocode to: Gocode.exe file under the Goeclipse installation path, as

F:\Work\eclipse\plugins\com.googlecode.goclipse.gocode_0.7.6.v450\tools\windows_386\gocode.exe

6, configure Support import remote package (optional)

In order to support the import remote package, it is best to install a gowin-env. Download Address: Https://bitbucket.org/akavel/gowin-env/downloads. If the following is a compressed package, please unzip it to C drive. For example, C:\gowin-env. There is a console.bat in the future using go get environment. Example: There is a file a.go, inside import (

"FMT"

"Github.com/astaxie/beedb"

_ "Github.com/ziutek/mymysql/godrv"

In order to compile the A.go file, you need to start Console.bat, and then in the Command Line window, go to c:\go\src directory and execute Go getgithub.com/astaxie/beedb

Go get github.com/ziutek/mymysql/godrv.

Go will automatically download the remote package and compile and install the packages.

7. Go install:no install location for directory * * * outside Gopath error handling

Since each go program must contain a main package and a main () function, this error can be caused by the absence of a main package.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.