增加Eclipse的配置
This commit is contained in:
54
1.4.md
54
1.4.md
@@ -241,6 +241,60 @@ Emacs传说中的神器,她不仅仅是一个编辑器,它是一个整合环
|
|||||||
|
|
||||||
6. 恭喜你,你现在可以体验在神器中开发Go的乐趣。默认speedbar是关闭的,如果打开需要把 ;; (speedbar 1) 前面的注释去掉,或者也可以通过 *M-x speedbar* 手动开启。
|
6. 恭喜你,你现在可以体验在神器中开发Go的乐趣。默认speedbar是关闭的,如果打开需要把 ;; (speedbar 1) 前面的注释去掉,或者也可以通过 *M-x speedbar* 手动开启。
|
||||||
|
|
||||||
|
## Eclipse
|
||||||
|
Eclipse也是非常常用的开发利器,以下介绍如何使用Eclipse来编写Go程序。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
1.首先下载并安装好[Eclipse](http://www.eclipse.org/)
|
||||||
|
|
||||||
|
2.下载[goeclipse](https://code.google.com/p/goclipse/)插件
|
||||||
|
|
||||||
|
http://code.google.com/p/goclipse/wiki/InstallationInstructions
|
||||||
|
|
||||||
|
3.下载gocode,用于go的代码补全提示
|
||||||
|
|
||||||
|
gocode 的github地址:
|
||||||
|
|
||||||
|
https://github.com/nsf/gocode
|
||||||
|
|
||||||
|
要安装git,在windows下,通常用[msysgit](https://code.google.com/p/msysgit/)
|
||||||
|
|
||||||
|
再在cmd下安装:
|
||||||
|
|
||||||
|
go get -u github.com/nsf/gocode
|
||||||
|
|
||||||
|
也可以下载代码,直接用go build来编译,会生成gocode.exe
|
||||||
|
|
||||||
|
4.下载[MinGW](http://sourceforge.net/projects/mingw/files/MinGW/)并按要求装好
|
||||||
|
|
||||||
|
5.配置插件
|
||||||
|
|
||||||
|
Windows->Reference->Go
|
||||||
|
|
||||||
|
(1).配置Go的编译器
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
(2).配置Gocode(可选,代码补全),设置Gocode路径为之前生成的gocode.exe文件
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
(3).配置GDB(可选,做调试用),设置GDB路径为MingW安装目录下的gdb.exe文件
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
6.测试是否成功
|
||||||
|
|
||||||
|
新建一个go工程,再建立一个hello.go。如下图:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
调试如下(要在console中用输入命令来调试):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## links
|
## links
|
||||||
* [目录](<preface.md>)
|
* [目录](<preface.md>)
|
||||||
* 上一节: [Go 命令](<1.3.md>)
|
* 上一节: [Go 命令](<1.3.md>)
|
||||||
|
|||||||
Reference in New Issue
Block a user